Is there a lighter weight interface to parsing events?

18 views
Skip to first unread message

Earl Hood

unread,
May 5, 2015, 12:12:10 AM5/5/15
to esp...@googlegroups.com
Is there an interface to the parser, that instead of returning a syntax tree object, one can pass in an object, or function, that can receiving parsing events?

I would like to do some checks on Identifier names, but it would be nice to avoid having to load a complete syntax tree into memory to do this.

An analogy would be XML parsers, where there is a SAX interface that provides lower level parsing events of the document, allowing one to perform less memory intensive parsing tasks without creating an entire parsed tree structure (i.e. the DOM) into memory.

Thanks,

--ewh

Ariya Hidayat

unread,
May 6, 2015, 9:12:43 PM5/6/15
to esp...@googlegroups.com
Hi Earl,

You may want to watch/track https://github.com/jquery/esprima/issues/1113. There is however a complication with ES6, namely its cover grammar. The mentioned issue describes the problem in details.

Thank you!

Best regards,

--
You received this message because you are subscribed to the Google Groups "esprima" group.
To unsubscribe from this group and stop receiving emails from it, send an email to esprima+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages