Show More
@@ -29,6 +29,9 b' class parser(object):' | |||
|
29 | 29 | t = self.current |
|
30 | 30 | self.current = next(self._iter, None) |
|
31 | 31 | return t |
|
32 | def _hasnewterm(self): | |
|
33 | 'True if next token may start new term' | |
|
34 | return bool(self._elements[self.current[0]][1]) | |
|
32 | 35 | def _match(self, m): |
|
33 | 36 | 'make sure the tokenizer matches an end condition' |
|
34 | 37 | if self.current[0] != m: |
@@ -59,7 +62,7 b' class parser(object):' | |||
|
59 | 62 | token, value, pos = self._advance() |
|
60 | 63 | infix, suffix = self._elements[token][2:] |
|
61 | 64 | # check for suffix - next token isn't a valid prefix |
|
62 |
if suffix and not self._ |
|
|
65 | if suffix and not self._hasnewterm(): | |
|
63 | 66 | expr = (suffix[0], expr) |
|
64 | 67 | else: |
|
65 | 68 | # handle infix rules |
General Comments 0
You need to be logged in to leave comments.
Login now