Skip to content

Commit

Permalink
Expose the tracking option through the Parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Smith authored and moses-palmer committed Oct 2, 2015
1 parent bf5b4bb commit 6aa92d6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/slimit/parser.py
Expand Up @@ -45,12 +45,14 @@ class Parser(object):
"""

def __init__(self, lex_optimize=True, lextab=lextab,
yacc_optimize=True, yacctab=yacctab, yacc_debug=False):
yacc_optimize=True, yacctab=yacctab, yacc_debug=False,
yacc_tracking=False):
self.lex_optimize = lex_optimize
self.lextab = lextab
self.yacc_optimize = yacc_optimize
self.yacctab = yacctab
self.yacc_debug = yacc_debug
self.yacc_tracking = yacc_tracking

self.lexer = Lexer()
self.lexer.build(optimize=lex_optimize, lextab=lextab)
Expand Down Expand Up @@ -90,7 +92,7 @@ def _raise_syntax_error(self, token):
)

def parse(self, text, debug=False):
return self.parser.parse(text, lexer=self.lexer, debug=debug)
return self.parser.parse(text, lexer=self.lexer, debug=debug, tracking=self.yacc_tracking)

def p_empty(self, p):
"""empty :"""
Expand Down

0 comments on commit 6aa92d6

Please sign in to comment.