diff --git a/assets/js/try.js b/assets/js/try.js index 6368561d6..b523cce34 100644 --- a/assets/js/try.js +++ b/assets/js/try.js @@ -44,8 +44,13 @@ function processGrammar () { } } - Jison.print = function () {}; - parser = Jison.Generator(cfg, {type: type}); + //Jison.print = function () {}; + try { + parser = 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");