Skip to content

Instantly share code, notes, and snippets.

@jml
Created January 17, 2013 23:22
Show Gist options
  • Save jml/4560832 to your computer and use it in GitHub Desktop.
Save jml/4560832 to your computer and use it in GitHub Desktop.
from parsley import makeGrammar
grammar = """
ws = ' ' | '\t' | '\r' | '\n'
keyword = ~ws+ letterOrDigit
"""
g = makeGrammar(grammar, {})
print g("something").keyword()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment