summaryrefslogtreecommitdiff
path: root/projects/hackc/parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'projects/hackc/parser.py')
-rw-r--r--projects/hackc/parser.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/projects/hackc/parser.py b/projects/hackc/parser.py
index 400b096..f73c3d1 100644
--- a/projects/hackc/parser.py
+++ b/projects/hackc/parser.py
@@ -29,8 +29,9 @@ SYMBOLS = "{}()[].,;+-*/&|<>=~"
class Parser:
- def __init__(self, fp):
+ def __init__(self, fp, extensions=[]):
self._fp = fp
+ self._extensions = extensions
self.tokens = []
def print_tokens(self):
@@ -80,7 +81,7 @@ class Parser:
break
rem = line[pos:] # remainder of line
- token = Token.from_line(rem, line_no, pos)
+ token = Token.from_line(rem, line_no, pos, extensions=self._extensions)
if token is not None:
self.tokens.append(token)
pos += token.length()