Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Thanks for your input podmaster. Here are a few valid JavaScript samples that don't parse too well.


var foo = 3 / 4 + 1 / 2;

is parsed as :

var foo = 3; / 4 + 1 /; 2;

var foo = (3/4) + 1 / 2; is not parsed at all (though I suspect it could be fixed by adjusting the precedence)

Elisions (though I have yet to see this construct in a real script)

var foo = foo[ , , bar];

Wrong parsing

bar ++foo;

Is parsed as:

bar++; foo;

Which is wrong. the parser should give an error (no line terminator allowed between 'bar' and '++') or be nice and get parse it as bar++;foo;

The following code is found in one of the the mozilla/js test script, but it doesn't seem to be valid, according to the specs (and obviously, doesn't parse).

try { //some stuff }catch (e if e == 3){ /* do stuff */ }

There are probably some more bugs, but the regex/division confusion is by far the most annoying

Update here is another major bugs due to the Optional Semicolon:

return a + b

Should be:

return; a + b;

But it is parsed as

return a + b;

This bug is mainly due to the fact that line terminators are silently skipped by the lexer

Update 2002-09-01: I'm glad to say that all these bugs are now fixed in the current version of this node (except for the elision.)


In reply to Re: Re: Parse::JavaScript by OeufMayo
in thread JavaScript::Parse::PurePerl (was Parse::JavaScript) by OeufMayo

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    [erix]: hm, there's a FANN perl module - looks a bit old
    [Cosmic37]: I'm afraid I don't know the answer to your map question...... what were the references too?
    [corenth]: each reference was to a fairly small scaler.
    [corenth]: I mean, array of scalers. usually triples.
    [Cosmic37]: there is a FANN discussion group but seems to have gone quiet... http://leenissen. dk/fann/forum/ viewforum.php?f=18 &sid=1afc1fb3fa1a3 7f52b03e40d05cdaaa 3

    How do I use this? | Other CB clients
    Other Users?
    Others about the Monastery: (7)
    As of 2018-02-20 18:29 GMT
    Find Nodes?
      Voting Booth?
      When it is dark outside I am happiest to see ...

      Results (274 votes). Check out past polls.