Permalink
Browse files

Update the slow lexer path to return Eol_Tok.

The 'minimal' dev build was broken.
  • Loading branch information...
Andy Chu
Andy Chu committed Dec 21, 2017
1 parent d1c0386 commit 0878d1b8d5fc9361e087a009fc8a85be98b5960d
Showing with 6 additions and 0 deletions.
  1. +6 −0 osh/parse_lib.py
View
@@ -19,6 +19,8 @@
except ImportError:
fastlex = None
Id = id_kind.Id
class MatchToken_Slow(object):
"""An abstract matcher that doesn't depend on OSH."""
@@ -29,6 +31,10 @@ def __init__(self, lexer_def):
def __call__(self, lex_mode, line, start_pos):
"""Returns (id, end_pos)."""
# Simulate the EOL handling in re2c.
if start_pos >= len(line):
return Id.Eol_Tok, start_pos
re_list = self.lexer_def[lex_mode]
matches = []
for regex, tok_type in re_list:

0 comments on commit 0878d1b

Please sign in to comment.