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

Unified Diff: tools/lexer_generator/code_generator.py

Issue 75153003: Experimental lexer generator: fix build after jinja2 came along. (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 | « 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/code_generator.py
diff --git a/tools/lexer_generator/code_generator.py b/tools/lexer_generator/code_generator.py
index 34f6f5ffa733fb179814b8dd71ae77b7c9a24021..4c6b033540b8425a50c56697c6ccaffb0a10a866 100644
--- a/tools/lexer_generator/code_generator.py
+++ b/tools/lexer_generator/code_generator.py
@@ -27,6 +27,8 @@
from dfa import Dfa
import jinja2
+import os
+import sys
class CodeGenerator:
@@ -50,6 +52,7 @@ class CodeGenerator:
assert(default_action and default_action.match_action())
default_action = default_action.match_action()
+ sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
template_env = jinja2.Environment(
loader = jinja2.PackageLoader('lexer_generator', '.'),
undefined = jinja2.StrictUndefined)
« 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