-
Notifications
You must be signed in to change notification settings - Fork 102
Streaming parser #81
Copy link
Copy link
Open
Labels
compat hazardResolving this issue may create backwards compatibility problemsResolving this issue may create backwards compatibility problemsenhancementRequest for functionality covering an entirely new use caseRequest for functionality covering an entirely new use case
Milestone
Description
Metadata
Metadata
Assignees
Labels
compat hazardResolving this issue may create backwards compatibility problemsResolving this issue may create backwards compatibility problemsenhancementRequest for functionality covering an entirely new use caseRequest for functionality covering an entirely new use case
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.