Skip to content

Instantly share code, notes, and snippets.

@natronium
Created June 28, 2017 06:54
Show Gist options
  • Save natronium/edcba05f7f474de150da472c1d1344b1 to your computer and use it in GitHub Desktop.
Save natronium/edcba05f7f474de150da472c1d1344b1 to your computer and use it in GitHub Desktop.
A Kaitai Struct testcase for python code generation
meta:
id: python_keyword_test
enums:
python_keywords:
# Since False, None and True aren't valid ksy ids,
# they don't need to be worried about
#1: False
#2: None
#3: True
4: and
5: as
6: assert
7: break
8: class
9: continue
10: def
11: del
12: elif
13: else
14: except
15: finally
16: for
17: from
18: global
19: if
20: import
21: in
22: is
23: lambda
24: nonlocal
25: not
26: or
27: pass
28: raise
29: return
30: try
31: while
32: with
33: yield
instances:
and:
value: python_keywords::and
as:
value: python_keywords::as
assert:
value: python_keywords::assert
break:
value: python_keywords::break
class:
value: python_keywords::class
continue:
value: python_keywords::continue
def:
value: python_keywords::def
del:
value: python_keywords::del
elif:
value: python_keywords::elif
else:
value: python_keywords::else
except:
value: python_keywords::except
finally:
value: python_keywords::finally
for:
value: python_keywords::for
from:
value: python_keywords::from
global:
value: python_keywords::global
if:
value: python_keywords::if
import:
value: python_keywords::import
in:
value: python_keywords::in
is:
value: python_keywords::is
lambda:
value: python_keywords::lambda
nonlocal:
value: python_keywords::nonlocal
not:
value: python_keywords::not
or:
value: python_keywords::or
pass:
value: python_keywords::pass
raise:
value: python_keywords::raise
return:
value: python_keywords::return
try:
value: python_keywords::try
while:
value: python_keywords::while
with:
value: python_keywords::with
yield:
value: python_keywords::yield
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment