# takes a header file, outputs action ids
-import token, tokenize, os, sys, string
+import tokenize, sys, string
def filter(g):
while 1:
if t == "enum" and state == classstate + 1:
actionname = tokens.next()
+ if actionname == "{":
+ while tokens.next() != "}":
+ pass
+ continue
+
if actionname[-7:] == "Actions":
if tokens.next() != "{":
try:
except:
pass
- raise "action enum must be simple."
+ raise Exception("action enum must be simple.")
counter = 0
if counter:
if t != ",":
- raise "no comma"
+ raise Exception("no comma")
t = tokens.next()
if firsthit:
if mode == "include":
# hack hack hack!!
- print "#include <lib" + f[2:] + ">"
+ print "#include <lib/" + '/'.join(f.split('/')[-2:]) + ">"
else:
print "\t// " + f