changed source folder
This commit is contained in:
72
source/compiler.lua
Normal file
72
source/compiler.lua
Normal file
@@ -0,0 +1,72 @@
|
||||
local basaltFileName = "basalt.lua"
|
||||
local absoluteFilePath = "source"
|
||||
|
||||
local requiredFiles = {
|
||||
"mainTop.lua",
|
||||
"mainBottom.lua",
|
||||
"Frame.lua",
|
||||
"Object.lua",
|
||||
"defaultTheme.lua",
|
||||
"minify.lua",
|
||||
"lib/drawHelper.lua",
|
||||
"lib/eventSystem.lua",
|
||||
"lib/process.lua",
|
||||
"lib/utils.lua",
|
||||
|
||||
}
|
||||
|
||||
local basalt = ""
|
||||
|
||||
for k,v in pairs(requiredFiles)do
|
||||
assert(fs.exists(fs.combine(absoluteFilePath, v)), "File "..v.." doesn't exists!")
|
||||
end
|
||||
|
||||
local lib = fs.list(fs.combine(absoluteFilePath, "lib"))
|
||||
local objects = fs.list(fs.combine(absoluteFilePath, "objects"))
|
||||
|
||||
local file = fs.open(fs.combine(absoluteFilePath, "mainTop.lua"), "r")
|
||||
basalt = basalt..file.readAll().."\n"
|
||||
file.close()
|
||||
|
||||
local file = fs.open(fs.combine(absoluteFilePath, "defaultTheme.lua"), "r")
|
||||
basalt = basalt..file.readAll().."\n"
|
||||
file.close()
|
||||
|
||||
for _,v in pairs(lib)do
|
||||
local path = fs.combine(fs.combine(absoluteFilePath, "lib"), v)
|
||||
if not(fs.isDir(path))then
|
||||
local file = fs.open(path, "r")
|
||||
basalt = basalt..file.readAll().."\n"
|
||||
file.close()
|
||||
end
|
||||
end
|
||||
|
||||
local file = fs.open(fs.combine(absoluteFilePath, "Object.lua"), "r")
|
||||
basalt = basalt..file.readAll().."\n"
|
||||
file.close()
|
||||
|
||||
for _,v in pairs(objects)do
|
||||
local path = fs.combine(fs.combine(absoluteFilePath, "objects"), v)
|
||||
if not(fs.isDir(path))then
|
||||
local file = fs.open(path, "r")
|
||||
basalt = basalt..file.readAll().."\n"
|
||||
file.close()
|
||||
end
|
||||
end
|
||||
|
||||
local file = fs.open(fs.combine(absoluteFilePath, "Frame.lua"), "r")
|
||||
basalt = basalt..file.readAll().."\n"
|
||||
file.close()
|
||||
|
||||
local file = fs.open(fs.combine(absoluteFilePath, "mainBottom.lua"), "r")
|
||||
basalt = basalt..file.readAll().."\n"
|
||||
file.close()
|
||||
|
||||
if(args[1]=="minify")then
|
||||
basalt = "a" -- have to work on
|
||||
end
|
||||
|
||||
|
||||
local b = fs.open(fs.combine(absoluteFilePath, "basalt.lua"), "w")
|
||||
b.write(basalt)
|
||||
b.close()
|
||||
@@ -1,12 +1,3 @@
|
||||
local basalt = { debugger = true, version = 1 }
|
||||
local activeFrame
|
||||
local frames = {}
|
||||
|
||||
local keyModifier = {}
|
||||
local parentTerminal = term.current()
|
||||
|
||||
local sub = string.sub
|
||||
|
||||
local updaterActive = false
|
||||
local function basaltUpdateEvent(event, p1, p2, p3, p4)
|
||||
if (event == "mouse_click") then
|
||||
7
source/mainTop.lua
Normal file
7
source/mainTop.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
local basalt = { debugger = true, version = 1 }
|
||||
local activeFrame
|
||||
local frames = {}
|
||||
local keyModifier = {}
|
||||
local parentTerminal = term.current()
|
||||
|
||||
local sub = string.sub
|
||||
3218
source/minify.lua
Normal file
3218
source/minify.lua
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user