mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
Update doc
This commit is contained in:
parent
bb45cc8fdd
commit
ec8a928272
4 changed files with 22 additions and 19 deletions
6
API.md
Normal file
6
API.md
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
Lua API reference
|
||||||
|
=================
|
||||||
|
|
||||||
|
We actively support LuaJIT and Lua 5.4. Lua 5.1, 5.2 and 5.3 *should* work but I don't always test against them.
|
||||||
|
|
||||||
|
TODO see anselme.lua, it is reasonably commentated and we should probably generate some documentation using LDoc.
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
Anselme reference
|
Anselme language reference
|
||||||
=================
|
==========================
|
||||||
|
|
||||||
Language reference
|
|
||||||
------------------
|
|
||||||
|
|
||||||
### Main structure
|
### Main structure
|
||||||
|
|
||||||
|
|
@ -940,13 +937,8 @@ This only works on strings:
|
||||||
|
|
||||||
Variables for default types (each is associated to a string of the internal variable type name): `nil`, `number`, `string`, `list`, `pair`, `function reference`, `variable reference`.
|
Variables for default types (each is associated to a string of the internal variable type name): `nil`, `number`, `string`, `list`, `pair`, `function reference`, `variable reference`.
|
||||||
|
|
||||||
#### Built-in languages
|
#### Built-in language scripts
|
||||||
|
|
||||||
Anselme provides some scripts that define translated aliases for built-in variables and functions. Currently `enUS` (English) and `frFR` (French) are provided.
|
Anselme provides some scripts that define translated aliases for built-in variables and functions. Currently `enUS` (English) and `frFR` (French) are provided.
|
||||||
|
|
||||||
See the `stdlib/languages` for details on each language.
|
See the `stdlib/languages` for details on each language.
|
||||||
|
|
||||||
API reference
|
|
||||||
-------------
|
|
||||||
|
|
||||||
TODO see anselme.lua
|
|
||||||
|
|
@ -68,4 +68,6 @@ TODO: stupidly complex script
|
||||||
Reference
|
Reference
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
See [REFERENCE.md](REFERENCE.md).
|
See [LANGUAGE.md](LANGUAGE.md) for a reference of the language.
|
||||||
|
|
||||||
|
See [API.md](API.md) for the Lua API's documentation.
|
||||||
|
|
|
||||||
17
anselme.lua
17
anselme.lua
|
|
@ -1,6 +1,6 @@
|
||||||
-- anselme module
|
-- anselme module
|
||||||
local anselme = {
|
local anselme = {
|
||||||
-- version
|
--- version
|
||||||
-- save is incremented a each update which may break save compatibility
|
-- save is incremented a each update which may break save compatibility
|
||||||
-- language is incremented a each update which may break script file compatibility
|
-- language is incremented a each update which may break script file compatibility
|
||||||
-- api is incremented a each update which may break Lua API compatibility
|
-- api is incremented a each update which may break Lua API compatibility
|
||||||
|
|
@ -9,7 +9,7 @@ local anselme = {
|
||||||
language = 21,
|
language = 21,
|
||||||
api = 4
|
api = 4
|
||||||
},
|
},
|
||||||
-- version is incremented at each update
|
--- version is incremented at each update
|
||||||
version = 22,
|
version = 22,
|
||||||
--- currently running interpreter
|
--- currently running interpreter
|
||||||
running = nil
|
running = nil
|
||||||
|
|
@ -63,11 +63,12 @@ end
|
||||||
|
|
||||||
--- interpreter methods
|
--- interpreter methods
|
||||||
local interpreter_methods = {
|
local interpreter_methods = {
|
||||||
-- interpreter state
|
--- interpreter state
|
||||||
|
-- for internal use, you shouldn't touch this
|
||||||
state = nil,
|
state = nil,
|
||||||
-- VM this interpreter belongs to
|
--- VM this interpreter belongs to
|
||||||
vm = nil,
|
vm = nil,
|
||||||
-- event that stopped the interpreter
|
--- event that stopped the interpreter
|
||||||
end_event = nil,
|
end_event = nil,
|
||||||
|
|
||||||
--- run the VM until the next event
|
--- run the VM until the next event
|
||||||
|
|
@ -211,10 +212,12 @@ interpreter_methods.__index = interpreter_methods
|
||||||
|
|
||||||
--- vm methods
|
--- vm methods
|
||||||
local vm_mt = {
|
local vm_mt = {
|
||||||
-- anselme state
|
--- anselme state
|
||||||
|
-- for internal use, you shouldn't touch this
|
||||||
state = nil,
|
state = nil,
|
||||||
|
|
||||||
-- loaded game state
|
--- loaded game state
|
||||||
|
-- for internal use, you shouldn't touch this
|
||||||
game = nil,
|
game = nil,
|
||||||
|
|
||||||
--- wrapper for loading a whole set of scripts
|
--- wrapper for loading a whole set of scripts
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue