Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.
/ LuaScript Public archive

Library and preprocessor for object-oriented programming in the Lua programming language.

License

Notifications You must be signed in to change notification settings

jotapapel/LuaScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuaScript

Library and preprocessor for object-oriented programming in the Lua programming language.
Repository · Documentation · Releases


Example lss file

/*
	Multiline comment
	another line,
	and another
*/

// single line comment

require dir.file

enum EnumName {
	Const1,
	Const2,
	Const3
}

final prototype PrototypeName: Prototype2, Prototype3 {

	static var z: object = Class(2, 3)
	var a: number = 99, b: string = "bootleg"
	const c = math.pi

	func d(...) {
	
	}
	
}

class Class1: Superclass, Prototype2, Prototype3 {

	var a: number = 99, b: string = "bootleg"
	const c = {
		a = 2,
		b = 33
	}
	
	constructor(a: string, b: number?) {
		
	}
	
	static func d(a: string, b: number?, c: any) -> (string) {
		try
			// something
		end
		return "string"
	}

}

Processed lua file (complete)

--[[
	Multiline comment
	another line,
	and another
--]]
-- single line comment
require("dir/file")
EnumName = enum({
	"Const1",
	"Const2",
	"Const3"
})
PrototypeName = prototype(true, "Prototype2", "Prototype3")({
	["static-z:object"] = Class(2, 3),
	["a:number"] = 99,
	["b:string"] = "bootleg",
	["c:constant"] = math.pi,
	["d"] = function(self, ...)
	end
})
Class1 = class(false, "Superclass", "Prototype2", "Prototype3")({
	["a:number"] = 99,
	["b:string"] = "bootleg",
	["c:constant"] = {
		a = 2,
		b = 33
	},
	["constructor"] = function(self, a, b)
		catch_types({"string", "number?"}, true, a, b)
	end,
	["static-d"] = function(self, a, b, c)
		return catch_types({"string"}, false, (function(self, a, b, c)
			catch_types({"string", "number?", "any"}, true, a, b, c)
			try_catch(self, function(self)
				-- something
			end)
			return "string"
		end)(self, a, b, c))
	end
})

Processed lua file (minimal)

require("dir/file")
EnumName = enum({
"Const1",
"Const2",
"Const3"
})
PrototypeName = prototype(true, "Prototype2", "Prototype3")({
["static-z:object"] = Class(2, 3)
["a:number"] = 99,
["b:string"] = "bootleg"
["c:constant"] = math.pi
["d"] = function(self, ...)
end
})
Class1 = class(false, "Superclass", "Prototype2", "Prototype3")({
["a:number"] = 99,
["b:string"] = "bootleg"
["c:constant"] = 
a = 2,
b = 33
})
constructor(a: string, b: catch_index("number")) {
}
static func d(a: string, b: catch_index("number"), c: any) -> (string) {
try_catch(self, function(self)
end)
return "string"
}
}

About

Library and preprocessor for object-oriented programming in the Lua programming language.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages