1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-27 16:49:31 +00:00

Bump version, update doc

This commit is contained in:
Étienne Fildadut 2021-12-06 18:48:32 +01:00
parent 04c6683de8
commit 037654ebcf
5 changed files with 36 additions and 25 deletions

View file

@ -903,7 +903,13 @@ This only works on strings:
#### Built-in variables #### Built-in variables
TODO see stdlib/bootscript.lua Variables for default types (each is associated to a string of the internal variable type name): `nil`, `number`, `string`, `list`, `pair`, `function reference`.
#### Built-in languages
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.
API reference API reference
------------- -------------

View file

@ -6,11 +6,11 @@ local anselme = {
-- api is incremented a each update which may break Lua API compatibility -- api is incremented a each update which may break Lua API compatibility
versions = { versions = {
save = 1, save = 1,
language = 19, language = 20,
api = 3 api = 4
}, },
-- version is incremented at each update -- version is incremented at each update
version = 20, version = 21,
--- currently running interpreter --- currently running interpreter
running = nil running = nil
} }

View file

@ -43,7 +43,11 @@ Reserved symbols that are still not used as a line type: `^+-=</[]*{}|\_!?.,;)"&
Broad goals and ideas that may never be implemented. Mostly used as personal post-it notes. Broad goals and ideas that may never be implemented. Mostly used as personal post-it notes.
TODO: some sensible way to capture text event in string litterals (string interpolation)? TODO: rewrite cycle, ... using function references
TODO: consider something like :identifier to create a string "identifier", might simplify the identifier=value special syntax and free up the = operator
TODO: some sensible way to capture text event in string litterals (string interpolation)? -> meh, this means we can capture choice events, and choice events contain their code block, and we don't want to store code blocks in the save file (as code can be updated/translated/whatever)
TODO: the function decorator feels a bit glued-on to the current syntax TODO: the function decorator feels a bit glued-on to the current syntax

View file

@ -1,5 +1,6 @@
local truthy, anselme, compare, is_of_type, identifier_pattern, format_identifier, find, get_variable local truthy, anselme, compare, is_of_type, identifier_pattern, format_identifier, find, get_variable
--- mark a table as modified, so it will be merged on the next checkpoint if it appears somewhere in a value
local function mark_as_modified(v) local function mark_as_modified(v)
local modified = getmetatable(anselme.running.state.variables).modified_tables local modified = getmetatable(anselme.running.state.variables).modified_tables
table.insert(modified, v) table.insert(modified, v)

View file

@ -1,27 +1,27 @@
return [[ return [[
(Types) (Types)
~ "nil".alias("nul") ~ "nil"!alias("nul")
~ "number".alias("nombre") ~ "number"!alias("nombre")
~ "string".alias("texte") ~ "string"!alias("texte")
~ "list".alias("liste") ~ "list"!alias("liste")
~ "pair".alias("paire") ~ "pair"!alias("paire")
(Built-in functions) (Built-in functions)
(~ "alias".alias("alias") (~ "alias"!alias("alias")
~ "name".alias("nom") ~ "name"!alias("nom")
~ "value".alias("valeur") ~ "value"!alias("valeur")
~ "len".alias("longueur") ~ "len"!alias("longueur")
~ "insert".alias("ajouter") ~ "insert"!alias("ajouter")
~ "remove".alias("retirer") ~ "remove"!alias("retirer")
~ "find".alias("trouver") ~ "find"!alias("trouver")
~ "error".alias("erreur") ~ "error"!alias("erreur")
~ "rand".alias("aléa") ~ "rand"!alias("aléa")
~ "raw".alias("brut") ~ "raw"!alias("brut")
(~ "type".alias("type") (~ "type"!alias("type")
~ "is of type".alias("est de type") ~ "is of type"!alias("est de type")
~ "cycle".alias("cycler") ~ "cycle"!alias("cycler")
~ "random".alias("aléatoire") ~ "random"!alias("aléatoire")
~ "next".alias("séquence") ~ "next"!alias("séquence")
(Built-in variables) (Built-in variables)
:alias 👁 = "vu" :alias 👁 = "vu"