language-javascript icon indicating copy to clipboard operation
language-javascript copied to clipboard

Only allow valid javascript AST's

Open mvcisback opened this issue 10 years ago • 1 comments

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.

mvcisback avatar Jul 03 '14 20:07 mvcisback

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.

erikd avatar Mar 18 '16 23:03 erikd