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

Unified Diff: tools/lexer_generator/automata_test.py

Issue 71313002: Experimental parser: action refactor (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/action_test.py ('k') | tools/lexer_generator/automaton.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/automata_test.py
diff --git a/tools/lexer_generator/automata_test.py b/tools/lexer_generator/automata_test.py
index ad44848c473ab9b4c79db3d6a73529aff5c16639..aa22186d7603da62906516dfb36db556ec7e82b5 100644
--- a/tools/lexer_generator/automata_test.py
+++ b/tools/lexer_generator/automata_test.py
@@ -26,6 +26,7 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
import unittest
+from automaton import Action
from regex_parser import RegexParser
from nfa_builder import NfaBuilder
from dfa import Dfa
@@ -80,8 +81,8 @@ class AutomataTestCase(unittest.TestCase):
dfa.to_dot()
def test_actions(self):
- left_action = ("LEFT_ACTION", "LEFT_CONDITION")
- right_action = ("RIGHT_ACTION", "RIGHT_CONDITION")
+ left_action = Action("LEFT_ACTION")
+ right_action = Action("RIGHT_ACTION")
left = RegexParser.parse("left")
right = RegexParser.parse("right")
left = NfaBuilder.add_action(left, left_action)
@@ -95,9 +96,9 @@ class AutomataTestCase(unittest.TestCase):
for i, action in enumerate(actions):
self.assertEqual(action, expected[i])
def verify_miss(string, expected):
- verify(string, expected + [('MISS',)])
+ verify(string, expected + [Action('MISS',)])
def verify_hit(string, expected):
- verify(string, expected + [('TERMINATE',)])
+ verify(string, expected + [Action('TERMINATE',)])
(l, r) = left_action, right_action
verify_hit("left", [l])
verify_miss("lefta", [l])
« no previous file with comments | « tools/lexer_generator/action_test.py ('k') | tools/lexer_generator/automaton.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698