Skip to content

Instantly share code, notes, and snippets.

@hellais
Created December 1, 2012 15:12
Show Gist options
  • Save hellais/4182820 to your computer and use it in GitHub Desktop.
Save hellais/4182820 to your computer and use it in GitHub Desktop.
import parsley
does_not_work = """foo = :x ?(x == '\x00') -> x"""
works = """foo = :x ?(x == '\x01') -> x"""
try:
parsley.makeGrammar(does_not_work, {})
except TypeError, e:
print e
g = parsley.makeGrammar(works, {})
p = g('\x01')
print ord(p.foo())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment