It is almost certainly too early to worry about this, but a couple notes while I'm thinking of them:
The tree grammar specified does not allow for (var a = b in c);, which is a legal program (in sloppy mode, assuming Annex B) as of https://github.com/tc39/ecma262/pull/614.
There's a variety of ways that well-typed trees can fail to correspond to real programs, which should all be captured in this project (except that said project hasn't been updated for async/await yet). For example, you can't have an if with an else as the body of an if without an else, even though the tree types can represent that. You also have to make sure that Identifiers are actually identifiers and that sort of thing. These aren't captured by the early error rules because they don't match the lexical grammar, and so presumably will need to be checked explicitly.
The type for TemplateExpression can be made more strict by having something like
instead of the current TemplateExpression definition which just has a list of elements which mixes Expressions and TemplateElements. Shift doesn't currently do this because it's kinda awkward to use (or, well, I think that was the justification, but have now forgotten), but this project might find it to be worth it.
It is almost certainly too early to worry about this, but a couple notes while I'm thinking of them:
The tree grammar specified does not allow
for (var a = b in c);
, which is a legal program (in sloppy mode, assuming Annex B) as of https://github.com/tc39/ecma262/pull/614.There's a variety of ways that well-typed trees can fail to correspond to real programs, which should all be captured in this project (except that said project hasn't been updated for
async
/await
yet). For example, you can't have anif
with anelse
as the body of anif
without anelse
, even though the tree types can represent that. You also have to make sure thatIdentifiers
are actually identifiers and that sort of thing. These aren't captured by the early error rules because they don't match the lexical grammar, and so presumably will need to be checked explicitly.The type for
TemplateExpression
can be made more strict by having something likeinstead of the current
TemplateExpression
definition which just has a list of elements which mixesExpression
s andTemplateElement
s. Shift doesn't currently do this because it's kinda awkward to use (or, well, I think that was the justification, but have now forgotten), but this project might find it to be worth it.