ply grammar: Fixup Tokenizer class so you can get lexer arguments
This commit is contained in:
parent
be0d74d6f6
commit
bae6a4a4d9
|
@ -55,6 +55,7 @@ class Tokenizer(object):
|
|||
break
|
||||
yield tok
|
||||
self.input = _input()
|
||||
self.lexer = lexer
|
||||
|
||||
def next(self):
|
||||
return self.input.next()
|
||||
|
@ -68,6 +69,9 @@ class Tokenizer(object):
|
|||
except StopIteration:
|
||||
return None
|
||||
|
||||
def __getattr__(self, attr):
|
||||
return getattr(self.lexer, attr)
|
||||
|
||||
class Grammar(object):
|
||||
def __init__(self, output=None, debug=False):
|
||||
self.yacc_args = {}
|
||||
|
|
Loading…
Reference in a new issue