Ah sweet.
10chars
Eh?
I made a converter, that converts from the old registerFunction format to the new e2function format.
To facilitate the development of his online documentation system, Syranide was going to apply it to all of the existing extensions, but maybe one of you extension devs wants to apply the converter himself.
Usage
converter is attached, have fun with it.
Use it by simply executing the file with any lua interpreter and doing conv("input.lua", "output.lua")
By default, it doesn't convert operators, since some operators use non-standard fetching code, which litters the console with errors.
To enable operator conversion, change line 2 to "local convert_operators = true"
If there are any unexplainable errors or warnings, post here.
What it doesn't do yet
some operators (++/inc --/dec =/ass $/dlt)
non-standard fetching, like here:
[highlight=Lua]registerOperator("add", "nn", "n", function(self, args)
local op1, op2 = args[2], args[3]
return op1[1](self, op1) + op2[1](self, op2)
end)[/highlight]
Disclaimer
If there are any warnings, the resulting code is unpredictable. Fix all warnings and test the code before uploading it anywhere.
This tool is for wiresvn extensions only. It may or may not work with custom extensions but these are not the scope of this tool.
Last edited by TomyLobo; 06-30-2009 at 06:50 PM.
"It's easy to win forgiveness for being wrong; being right is what gets you into real trouble." - Bjarne Stroustrup
Lífið læðist lúmskt áfram
Ah sweet.
10chars
Bookmarks