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

Unified Diff: tools/lexer_generator/generator.py

Issue 62163003: Experimental parser: catch oom from asm when running viz (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/generator.py
diff --git a/tools/lexer_generator/generator.py b/tools/lexer_generator/generator.py
index cf19267432da892a861b793a2d4a2db0bd107fb1..9b1de46b418ae7b71f00e8a4f49c9e19ed0e93ef 100644
--- a/tools/lexer_generator/generator.py
+++ b/tools/lexer_generator/generator.py
@@ -37,7 +37,11 @@ file_template = '''
function draw(name, id) {
code = document.getElementById(id).innerHTML
document.body.innerHTML += "<h1>" + name + "</h1>";
- document.body.innerHTML += Viz(code, 'svg');
+ try {
+ document.body.innerHTML += Viz(code, 'svg');
+ } catch(e) {
+ document.body.innerHTML += "<h3>error</h3>";
+ }
}
</script>
</head>
@@ -85,7 +89,8 @@ def process_rules(parser_state):
(start, dfa_nodes) = nfa.compute_dfa()
dfa = Dfa(start, dfa_nodes)
html_data.append((rule_name, nfa, dfa))
- print generate_html(html_data)
+ html = generate_html(html_data)
+ # print html
def parse_file(file_name):
parser_state = RuleParserState()
« 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