[Metalua-list] Re: metalua source parsing
fleutot at gmail.com
Sun Sep 14 15:49:39 GMT+2 2008
I think we have opposite approaches to the problem:
- you want your AST to be a self-sufficient structure, that you can
manipulate, then dump in a form that's precisely controlled (and by default
identical to the source code it comes from)
- I see the AST as some sort of index to the sources, in which I can
navigate easily, and in which I can replace some pieces of code. I don't
want the AST to be able to regenerate the code from scratch, I just want it
to let me perform "surgical" changes: I expect the pieces of user code that
I didn't touch stay identical *because I didn't touch them*, not because I'm
able to regenerate them from scratch.
Case in point, the "do" keyword in a for loop: if I modify the loop
boundaries and the loop body, I'm going to weave my modified code at the
positions of the old loop boundaries and loop body code, without touching
the for loop itself, nor its textual representation. I'll let the "do"
keyword untouched (with any spaces, '\n', '\t', or comments around it)
rather than re-generating it.
I have thought of another use-case here. It seemed to me that metalua
> would be fine back-end for Lua syntax highlighting plugin for some
My company is very open-source friendly, employs a bunch of Eclipse gurus
and committers, and works on some stuff which heavily rely on Lua. Stay
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Metalua-list