luaparse icon indicating copy to clipboard operation
luaparse copied to clipboard

Streaming parser

Open fstirlitz opened this issue 6 years ago • 0 comments

Right now this parser can only generate an AST when the entire input has been put in a single string value; only lexing seems to be possible in a streaming manner (although I have not tested if it works reliably). It would be useful to have a streaming parser which can process a Lua script without holding it in memory in its entirety.

If this feature is added, it will definitely only going to be in a major, backwards-incompatible release. I dare even say that this is the kind of feature for the sake of which I might drop my curmudgeonly attitude towards new language features, because a natural way to achieve it would be via asynchronous generators, only available since ECMA-262 9th Ed.; there's no way I'd be dealing with the callback extra-hell that would otherwise result.

fstirlitz avatar Jan 12 '20 13:01 fstirlitz