Skip to content

Instantly share code, notes, and snippets.

@tripped
Created December 1, 2012 23:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripped/4185952 to your computer and use it in GitHub Desktop.
Save tripped/4185952 to your computer and use it in GitHub Desktop.
The sane way to parse [19 02] control code arguments
def parse_19_02(source):
str = []
cur = next(source)
while cur != 1 and cur != 2:
str.append(cur)
cur = next(source)
str = ('String', str)
if cur == 2:
return ('19 02', [str], 'load "#a"')
else:
return ('19 02', [str, parse_long(source)], 'load "#a" -> $#bbbbbb')
@Herringway
Copy link

HEH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment