Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: tools/lexer_generator/lexer_test.py

Issue 76263003: Experimental lexer generator: make tests pass again + style fixes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/lexer_generator/code_generator_test.py ('k') | tools/lexer_generator/transition_keys.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/lexer_test.py
diff --git a/tools/lexer_generator/lexer_test.py b/tools/lexer_generator/lexer_test.py
index cd65207ce5d26ac867a61656a04224514b219039..861afc0d98363d5b1a99fb0496aca7290ec247a8 100644
--- a/tools/lexer_generator/lexer_test.py
+++ b/tools/lexer_generator/lexer_test.py
@@ -42,36 +42,39 @@ class LexerTestCase(unittest.TestCase):
def test_simple(self):
rules = '''
+ eos = [:eos:];
<<default>>
"(" <|LBRACE|>
")" <|RBRACE|>
"foo" <|FOO|>
- eof <|terminate|>'''
+ eos <|terminate|>'''
- string = 'foo()\0'
+ string = 'foo()'
self.__verify_action_stream(rules, string,
[('FOO', 'foo'), ('LBRACE', '('), ('RBRACE', ')')])
def test_maximal_matching(self):
rules = '''
+ eos = [:eos:];
<<default>>
"<" <|LT|>
"<<" <|SHL|>
" " <|SPACE|>
- eof <|terminate|>'''
+ eos <|terminate|>'''
- string = '<< <\0'
+ string = '<< <'
self.__verify_action_stream(rules, string,
[('SHL', '<<'), ('SPACE', ' '), ('LT', '<')])
def test_consecutive_epsilon_transitions(self):
rules = '''
+ eos = [:eos:];
digit = [0-9];
number = (digit+ ("." digit+)?);
<<default>>
number <|NUMBER|>
- eof <|terminate|>'''
+ eos <|terminate|>'''
- string = '555\0'
+ string = '555'
self.__verify_action_stream(rules, string, [('NUMBER', '555')])
« no previous file with comments | « tools/lexer_generator/code_generator_test.py ('k') | tools/lexer_generator/transition_keys.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698