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

Unified Diff: tools/lexer_generator/nfa_builder.py

Issue 155763005: Experimental parser: small cleanup (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/lexer_generator/nfa_builder.py
diff --git a/tools/lexer_generator/nfa_builder.py b/tools/lexer_generator/nfa_builder.py
index 97ecfa15512dd843c8d86170349a378e020f56cc..dfb57504a63745348e0fb5672354de21b9aa8b23 100644
--- a/tools/lexer_generator/nfa_builder.py
+++ b/tools/lexer_generator/nfa_builder.py
@@ -309,22 +309,19 @@ class NfaBuilder(object):
def __flatten_terms(terms, name):
for term in terms:
assert isinstance(term, Term)
- if not term:
- continue
if term.name() == name:
for arg in term.args():
if arg:
yield arg
else:
- yield term
+ if term:
+ yield term
@staticmethod
def __flatten_literals(terms):
acc = ()
for term in terms:
assert isinstance(term, Term)
- if not term:
- continue
if term.name() == 'LITERAL':
acc += term.args()
else:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698