diff --git a/assets/js/try.js b/assets/js/try.js index f68fa825d..c0aab9d7c 100644 --- a/assets/js/try.js +++ b/assets/js/try.js @@ -8,8 +8,9 @@ if(typeof console === 'undefined'){ console = {}; console.log = function (str) {$("#out").text(uneval(str))}; } -// noop -print = function (){} + +// Can't just do 'print = console.log' because of chromium bug #179628 +print = console.log.bind(console); var printOut = function (str) { $("#out").text(str); }; @@ -43,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").text("Oops. Error while parsing grammar.\n"+e).addClass('bad'); + throw(e); + } $("#out").removeClass("good").removeClass("bad").html(''); $("#gen_out").removeClass("good").removeClass("bad"); diff --git a/assets/styles/style.css b/assets/styles/style.css index 322573cdb..087a36034 100644 --- a/assets/styles/style.css +++ b/assets/styles/style.css @@ -41,12 +41,12 @@ textarea { display: block; width: 586px; height: 200px; - background: url(/jison/assets/images/jison_x1.png) no-repeat; + background: url(../images/jison_x1.png) no-repeat; outline-style: none; margin: 0 auto; /* center the jison logo */ } #header h1 a:active { - background: url(/jison/assets/images/jison_x1.png) no-repeat 2px 3px; + background: url(../images/jison_x1.png) no-repeat 2px 3px; } #header h2 { diff --git a/assets/styles/try.css b/assets/styles/try.css index f6c402a81..b31dc4b6c 100644 --- a/assets/styles/try.css +++ b/assets/styles/try.css @@ -1,6 +1,51 @@ a img { border: 0px; } + +#content { + max-width: none; +} + +#content > div { + max-width: 600px; + margin: 0 auto; /* center horizontally */ +} + + +/* -- two column fluid layout */ +div#try { + max-width: none; +} + +#describe { + float: left; + width: 45%; + margin-left: 2%; + min-width: 20em; +} + +#test { + float: left; + width: 46%; + margin-left: 2%; + min-width: 20em; +} + +/* +clearing without extra
, it could be + + #footer { clear: both; } + +*/ +div#try:after { + content: ""; + display: table; + clear: both; +} + +/* /- two column fluid layout */ + + #try textarea { width: 100%; } diff --git a/index.html b/index.html index 6c2f6559b..acad72b83 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,7 @@ Jison - + @@ -25,16 +25,16 @@ -->
-

Hunh?

+

Hunh?

- Read the documentation, see - some demos, try it online, or - install! + Read the documentation, see + some demos, try it online, or + install!

diff --git a/try/index.html b/try/index.html index 134b4c52d..cb440bf3f 100644 --- a/try/index.html +++ b/try/index.html @@ -3,7 +3,7 @@ Jison / - +

Suggestion

You may also want to try the Jison USF page which includes logic to show the productions and state transition diagram. This can be very useful for debugging your grammar!

- - - - - - + + + + + + +
Fork me on GitHub + - - - - + + + + + - +