changed source folder

This commit is contained in:
Robert Jelic
2022-05-19 18:07:02 +02:00
parent 48fc275afd
commit fc45d284d2
4 changed files with 3297 additions and 9 deletions

72
source/compiler.lua Normal file
View 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()

View File

@@ -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
View 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

File diff suppressed because it is too large Load Diff