ply grammar: Fixup Tokenizer class so you can get lexer arguments
This commit is contained in:
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user