From: glathoud on
Hello, I ported the SpiderMonkey Narcissus parser to other
"Javascript" engines and wanted to share the resulting code [1]. As an
example, I wrote a code checker [2] that uses the parser.

Best regards,

Guillaume Lathoud

[1] cross-engine Narcissus parser for ECMAScript 3:
http://glathoud.easypagez.com/publications/jscheck/narcissus.jsdef.js
http://glathoud.easypagez.com/publications/jscheck/narcissus.parse.js
..
The parser works correctly on Firefox 3.6, Safari 4, Google Chrome 4
and the Google V8 Engine. Sadly, the parser breaks on Opera 10.10 -
help is appreciated.

[2] http://glathoud.easypagez.com/publications/jscheck/jscheck.xhtml
From: glathoud on
Sorry the second link in [1] was:
http://glathoud.easypagez.com/publications/jscheck/narcissus.jsparse.js
From: kangax on
On 3/26/10 12:13 PM, glathoud wrote:
> Hello, I ported the SpiderMonkey Narcissus parser to other
> "Javascript" engines and wanted to share the resulting code [1]. As an
> example, I wrote a code checker [2] that uses the parser.
>
> Best regards,
>
> Guillaume Lathoud
>
> [1] cross-engine Narcissus parser for ECMAScript 3:
> http://glathoud.easypagez.com/publications/jscheck/narcissus.jsdef.js
> http://glathoud.easypagez.com/publications/jscheck/narcissus.parse.js
> .
> The parser works correctly on Firefox 3.6, Safari 4, Google Chrome 4
> and the Google V8 Engine. Sadly, the parser breaks on Opera 10.10 -
> help is appreciated.

How exactly does it break in Opera? Also, how ES3-compliant is your
port? Have you tried running it through, say, SputnikTests
(<http://code.google.com/p/sputniktests/>,
<http://kangax.github.com/sputniktests-webrunner/>)?

--
kangax
From: glathoud on
On Mar 27, 7:02 pm, kangax <kan...(a)gmail.com> wrote:
> How exactly does it break in Opera?

On parsing the original jsparse.js implementation. In more details:

* Open with Opera 10.10:
http://glathoud.easypagez.com/publications/jscheck/test-narcissus-xengine.html

* Open the Dragonfly developer tools.

* Click on the button "Start the test"

* You can then see the crash, somewhere deep in the parser:
| // Always use push to add operands to an expression, to update start
and end.
| Np.push = function (kid) {
| if (kid.start < this.start) // <<<< kid === undefined
| this.start = kid.start;

The `operands` array in the `Expression` seems to be somewhat
mismanaged under Opera. Curiously, there was no such problem in
Firefox 3.6, Safari 4, Google Chrome 4 and the Google V8 Engine (and
even Rhino).

> Also, how ES3-compliant is your
> port? Have you tried running it through, say, SputnikTests
> (<http://code.google.com/p/sputniktests/>,
> <http://kangax.github.com/sputniktests-webrunner/>)?

Thanks for the links. That would certainly be perfect to test the full
Narcissus implementation (parser + interpreter).
However, so far I only ported the parser. If you'd like to port the
interpreter as well, you are welcome!

In any case, I'll keep the Sputnik tests in mind.

Guillaume
From: glathoud on
Opera 10.10 is now supported by the Narcissus parser and the code
checker.
 | 
Pages: 1
Prev: IE9.js
Next: how to hid highlighting?