Made BisonSyntaxError's arguments optional.

parent 5f74eb1a
...@@ -24,9 +24,10 @@ from bison_ import ParserEngine ...@@ -24,9 +24,10 @@ from bison_ import ParserEngine
from .node import BisonNode from .node import BisonNode
class BisonSyntaxError(Exception): class BisonSyntaxError(Exception):
def __init__(self, msg, args): def __init__(self, msg, args=[]):
super(BisonSyntaxError, self).__init__(msg) super(BisonSyntaxError, self).__init__(msg)
if args:
self.first_line, self.first_col, self.last_line, self.last_col, \ self.first_line, self.first_col, self.last_line, self.last_col, \
self.message, self.token_value = args self.message, self.token_value = args
......
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