def literal_kind(string): return one_that(lambda token: token.kind == string)
def an_instance(type_): return one_that(lambda x: isinstance(x, type_)) def capture1(p): return capture(p) >> (lambda x: x[0]) # Ouch
def Token(name): return label(one_that(lambda t: t[1] == name), name) # XXX def RuleRef(name): return delay((lambda: rules[name]), name)
def an_instance(type_): return one_that(lambda x: isinstance(x, type_))
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