#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))
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
%{
%}
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)
exit 0
############ Put tokens here ############
-## shell
+## dotlock
+## editor
+## quit
## sendmail
+## shell