On Thursday, February 8, 2018 at 12:01:27 PM UTC-6, Edward K. Ream wrote:

We can see the problem in the electron "hello world" javascript code.  The 
> importer fails to recognize these two event handlers:
> app.on('window-all-closed', () => {
>   // whatever
> })
> app.on('activate', () => {
>   // whatever
> })
> The fault lies in js_i.starts_block.  It only recognizes the start of a 
> function if a line that increases the { level *also* contains the word 
> "function".  Clearly, it should use a more sophisticated pattern matcher.

> In general, recognizing js functions is hard because there are many ways 
> to start functions/methods in javascript. 

Well, it's no good whinging about javascript syntax. Invention is required.

js_i.starts_block return True if the line should start a new node.  It 
might more profitably look for lines that *don't/can't* start a function.  
But this seems like a dubious idea now that I look into it.

In the example given above, looking for '=>' would work...


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 leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to