Closed RobertBColton closed 8 years ago
It's quite easy but not exposed to the outside. Just check Loader_Fast.LoadChunk to udnerstand how to trigger parsing and get an AST.
That uses a lot of internal classes - just import the sources instead of the DLLs and you are basically done. Every node in the AST has the references to the source code.
So for a special project I am doing I would like to be able to parse a Lua and then walk the AST and get the line numbers and ranges of each node. I am wanting to do this so that I can create an interactive code editor with drag and drop for Lua (it's just an experiment). It will be similar to say a class hierarchy in Visual Studio or Eclipse.
Is this at all possible with MoonSharp to get line numbers of the AST nodes and is the functionality considered "stable"? If it is not is there perhaps a simpler NuGet package that can do this for me?