Hi,

I am using Rhino's Parser to get the AST for a javascript source.
But when i convert it back to source (using AstRoot.toSource() ), Variable
declarations don't get converted properly (they miss a ";\n").

*Example Source to the Parser:*

var y = 'Hello!';
print(y);
for(var i=0;i<10;i++){
  print(i)
}

*AstRoot.toSource():*

var y = 'Hello!'print(y);
for (var i = 0; i < 10; i++)
  {
    print(i);
  }

Notice that there is no ";\n" after the first line.
My first idea was to append a ";\n" in the toString() of
VariableDeclaration; but that breaks the variable declaration in the for
loop.

Any ideas/suggestions would be appreciated.

Thanks,
Shauvik
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to