Example #1
0
def literal_kind(string):
    return one_that(lambda token: token.kind == string)
Example #2
0
def an_instance(type_): return one_that(lambda x: isinstance(x, type_))

def capture1(p): return capture(p) >> (lambda x: x[0]) # Ouch
Example #3
0
def Token(name):   return label(one_that(lambda t: t[1] == name), name) # XXX
def RuleRef(name): return delay((lambda: rules[name]), name)
Example #4
0
def an_instance(type_):
    return one_that(lambda x: isinstance(x, type_))
Example #5
0
def Literal(s):    return label(one_that(lambda t: t[1] == s), repr(s)) # XXX
def Token(name):   return label(one_that(lambda t: t[1] == name), name) # XXX