Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Expose tolerant option in parsing demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
jryans committed Nov 9, 2012
1 parent 271d358 commit 9390d5a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions demo/parse.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@
comment: document.getElementById('comment').checked,
raw: document.getElementById('raw').checked,
range: document.getElementById('range').checked,
loc: document.getElementById('loc').checked
loc: document.getElementById('loc').checked,
tolerant: document.getElementById('tolerant').checked
};

document.getElementById('tokens').value = '';
Expand Down Expand Up @@ -269,7 +270,8 @@ <h1>Parser <small>produces syntax tree</small></h1>
</textarea></div>
<p id="codemirror" align="right"><small>The above code editor is based on <a href="http://codemirror.net" target="_blank">CodeMirror</a>.</small></p>
<p><label><input type="checkbox" id="raw"> Preserve raw value of literals</label>
<label><input type="checkbox" id="comment"> Include comments</label></p>
<label><input type="checkbox" id="comment"> Include comments</label>
<label><input type="checkbox" id="tolerant"> Tolerate errors</label></p>
<p>Syntax node location info (start, end):
<label><input type="checkbox" id="range">Index-based range</label>
<label><input type="checkbox" id="loc">Line and column-based</label></p>
Expand Down Expand Up @@ -372,13 +374,15 @@ <h3><a id="show_url">URL</a></h3>
document.getElementById('range').onchange = quickParse;
document.getElementById('loc').onchange = quickParse;
document.getElementById('tokens').onchange = quickParse;
document.getElementById('tolerant').onchange = quickParse;

// Special handling for IE.
document.getElementById('comment').onclick = quickParse;
document.getElementById('raw').onclick = quickParse;
document.getElementById('range').onclick = quickParse;
document.getElementById('loc').onclick = quickParse;
document.getElementById('tokens').onclick = quickParse;
document.getElementById('tolerant').onclick = quickParse;

window.checkEnv();

Expand Down

0 comments on commit 9390d5a

Please sign in to comment.