language-javascript
language-javascript copied to clipboard
Only allow valid javascript AST's
skimming through the code, it seems that all non-leaf nodes can allow any node as a child. This allows AST's to potentially represent invalid programs. It would be nice to be able to explicitly require the program to be correct by being representable by the tree.
Yes, it would be nice if the AST was "correct-by-construction". The code in the existing master branch allows the construction of all sorts of totally invalid ASTs.
There is however a new-ast
branch which is a vast improvement over the code in master
, but does not completely solve the problem. I'm hoping to release version 0.6.0.0 which uses this new AST today.