Improving how the javascript importer assigns lines to nodes has a high
priority. Javascript is arguably the most important computer language in
the world.
We both want the js importer to do as well as possible, especially with all
common idioms, whatever they are ;-)
Suppose Vitalije devise a truly excellent js parser that knows (somehow!)
how to split a js file into lines. Imo, we can prove the following theorem:
js_i.gen_lines and its helpers can implement any stand-alone parse of
javascript.
At present, the guts of the js importer is just js_i.starts_block, a helper
of the i.gen_lines in the *base *Importer class in
importers/linescanner.py. The theorem implies that the js importer might
have to override i.gen_lines, creating js_i.gen_lines and who knows what
helpers.
The theorem is important because the base Importer class provides a lot of
services. In particular, it handles tokenizing javascript. Tokenizing is
fraught because recognizing regex expressions depends on context. A
*prototype* js parser could ignore such things,
*Summary*
Here is my proposed strategy:
1. Verify that a new parser does substantially better than the present
code. I trust that Vitalije can do this.
2. Do whatever is necessary to recast the algorithm in terms of the
existing Importer organization. I'll know what this entails only when I see
the new parser algorithm and its code.
Edward
P. S. A *strict parser* never split incoming lines into two (or more?)
lines. A* lenient parser* may split incoming lines. A strict parser will
"just work" with Leo's existing Importer base class. A lenient parser
would probably require tweaks to the prefect import tests, but this is not
a deal breaker.
Vitalije, are you thinking of a strict or lenient parser?
EKR
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.