Skip to content

Commit

Permalink
Show generator exceptions as errors on try web page
Browse files Browse the repository at this point in the history
  • Loading branch information
techtonik committed Feb 8, 2016
1 parent 0fef98a commit bd51b33
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions assets/js/try.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ function processGrammar () {
}
}

Jison.print = function () {};
parser = new Jison.Generator(cfg, {type: type});
//Jison.print = function () {};
try {
parser = new Jison.Generator(cfg, {type: type});
} catch(e) {
$("#gen_out").html("Oops. Error while parsing grammar.\n"+e).addClass('bad');
throw(e);
}

$("#out").removeClass("good").removeClass("bad").html('');
$("#gen_out").removeClass("good").removeClass("bad");
Expand Down

0 comments on commit bd51b33

Please sign in to comment.