I'm in the process of simplifying the structure of the AST, doing things like resolving variable references, flattening nested blocks and transforming switch statements into nested ifs. One thing that I'm unclear about is wether blocks add anything to the semantics other than just grouping statements. For example, is the program
var foo = 1; print(foo);
equivalent to
{ var foo = 1; print(foo); }
?
It is hard to decipher the ECMAScript spec to guarantee that it is so (which I think it is). Anyone have an opinion?
Marc