stylish updates.
[apps/madmutt.git] / lib-lua / lua-token.sh
index 4bf256f..b715c37 100644 (file)
@@ -38,8 +38,9 @@ do_h() {
 #define MUTT_LIB_LUA_LUA_TOKEN_H
 
 enum lua_token {
-    LTK_UNKNOWN,
+    LTK_UNKNOWN = -1,
 `tr 'a-z-/' 'A-Z__' | sed -e 's/.*/    LTK_&,/'`
+    LTK_count,
 };
 
 __attribute__((pure))
@@ -48,6 +49,12 @@ enum lua_token lua_which_token(const char *s, ssize_t len);
 EOF
 }
 
+do_tokens() {
+    while read tok; do
+        echo "$tok, LTK_`echo $tok | tr 'a-z-' 'A-Z_'`"
+    done
+}
+
 do_c() {
     cat <<EOF | gperf -m16 -l -t -C -F",0" -Nlua_which_token_aux
 %{
@@ -62,7 +69,7 @@ lua_which_token_aux(const char *str, unsigned int len);
 %}
 struct tok { const char *name; int val; };
 %%
-`awk '{print $0 ", " NR }'`
+`do_tokens`
 %%
 
 enum lua_token lua_which_token(const char *s, ssize_t len)
@@ -97,5 +104,8 @@ chmod -w $1
 exit 0
 
 ############ Put tokens here ############
-## shell
+## dotlock
+## editor
+## quit
 ## sendmail
+## shell