Issue found and fixed by Björn <wolfbjoe>.
Fixes #21.
... | ... |
@@ -950,6 +950,12 @@ class Parser: |
950 | 950 |
|
951 | 951 |
def skip(self, type): |
952 | 952 |
while self.lookahead.type != type: |
953 |
+ if self.lookahead.type == EOF: |
|
954 |
+ raise ParseError( |
|
955 |
+ msg = 'unexpected end of file', |
|
956 |
+ filename = self.lexer.filename, |
|
957 |
+ line = self.lookahead.line, |
|
958 |
+ col = self.lookahead.col) |
|
953 | 959 |
self.consume() |
954 | 960 |
|
955 | 961 |
def consume(self): |