Set default node class to BisonNode instead of None.

parent 1bd7873d
...@@ -21,7 +21,7 @@ import sys ...@@ -21,7 +21,7 @@ import sys
import traceback import traceback
from bison_ import ParserEngine from bison_ import ParserEngine
from .node import BisonNode
class BisonSyntaxError(Exception): class BisonSyntaxError(Exception):
pass pass
...@@ -100,7 +100,7 @@ class BisonParser(object): ...@@ -100,7 +100,7 @@ class BisonParser(object):
# Class to use by default for creating new parse nodes. If set to None, # Class to use by default for creating new parse nodes. If set to None,
# BisonNode will be used. # BisonNode will be used.
default_node_class = None default_node_class = BisonNode
def __init__(self, **kw): def __init__(self, **kw):
""" """
...@@ -184,10 +184,6 @@ class BisonParser(object): ...@@ -184,10 +184,6 @@ class BisonParser(object):
if self.verbose: if self.verbose:
print 'no handler for %s, using default' % targetname print 'no handler for %s, using default' % targetname
if not self.default_node_class:
from .node import BisonNode
self.default_node_class = BisonNode
self.last = self.default_node_class(targetname, option=option, self.last = self.default_node_class(targetname, option=option,
names=names, values=values) names=names, values=values)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment