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

Unified Diff: tools/lexer_generator/rule_parser_test.py

Issue 135053003: Experimental parser: remove inline code from lexer rules (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 11 months 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/rule_parser.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/rule_parser_test.py
diff --git a/tools/lexer_generator/rule_parser_test.py b/tools/lexer_generator/rule_parser_test.py
index 4af19e183ad5213f7751c22dac58ba7e6899f719..bdf6bb1a8fa431a64f7c3e1480964a648f11bf4f 100644
--- a/tools/lexer_generator/rule_parser_test.py
+++ b/tools/lexer_generator/rule_parser_test.py
@@ -43,10 +43,10 @@ class RuleParserTestCase(unittest.TestCase):
alias = /regex/;
<<cond1>> /regex/ <||cond2>
<<cond1>> alias <||cond2>
-<<cond2>> /regex/ <|{body}|>
-<<cond2>> alias <|{body}|>
-<<cond3>> /regex/ <{body}||>
-<<cond3>> alias <{body}||>''')
+<<cond2>> /regex/ <|body|>
+<<cond2>> alias <|body|>
+<<cond3>> /regex/ <body||>
+<<cond3>> alias <body||>''')
self.assertTrue(len(self.state.aliases), 1)
self.assertTrue('alias' in self.state.aliases)
@@ -74,8 +74,8 @@ alias = /regex/;
def test_more_complicated(self):
self.parse('''
alias = "regex;with;semicolon";
-<<cond1>> "regex3}with}braces}" <|{body {with} braces }|>
-<<cond1>> "regex4{with{braces}" <{body {with} braces }||>''')
+<<cond1>> "regex3}with}braces}" <|body|>
+<<cond1>> "regex4{with{braces}" <body||>''')
self.assertEquals(self.state.aliases['alias'],
RegexParser.parse("regex;with;semicolon"))
@@ -85,15 +85,3 @@ alias = "regex;with;semicolon";
# self.assertEquals(
# self.parse['cond1']['regex4{with{braces}'],
# ('body', 'body {with} braces }'))
-
- def test_body_with_if(self):
- self.parse('<<cond>> "regex" <|{ if (foo) { bar } }|>')
- # self.assertEquals(
- # self.parse['cond']['regex'],
- # ('body', 'if (foo) { bar }'))
-
- def test_regexp_with_count(self):
- self.parse('<<cond>> /regex{1,3}/ <|{ if (foo) { bar } }|>')
- # self.assertEquals(
- # self.parse['cond']['regex{1,3}'],
- # ('body', 'if (foo) { bar }'))
« no previous file with comments | « tools/lexer_generator/rule_parser.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698