Posted 18 July 2014 - 07:28 AM
I'm working on releasing Bedrock at the moment and one of the things I'm trying to do is put the APIs in table form in the one file. So, essentially there are about 15 or so other files which I'd like to keep separate in development (to keep the code clean), however, when I run a file it will copy the base API and all the other API files in to one file when it's ready for release. The easiest (that I can think of) way to do this is to simply have each API as a table in the final file.
So essentially, I'd like to be able to turn this:
In to this:
I could probably make it find an end with no tabs and put a colon, but if there's a better way to do it I'd rather do that.
So essentially, I'd like to be able to turn this:
--a file called example
test = function() --most of my APIs already use the ** = function layout, which might make things easier
print('Test')
end
In to this:
--one big API
example = {
test = function()
print('test')
end
}
example.test()
I could probably make it find an end with no tabs and put a colon, but if there's a better way to do it I'd rather do that.
Edited on 18 July 2014 - 05:29 AM