1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-28 00:59:31 +00:00
This commit is contained in:
Étienne Fildadut 2021-12-12 16:31:19 +01:00
parent e7cfab524a
commit f5382d2912
4 changed files with 8 additions and 1 deletions

View file

@ -881,6 +881,8 @@ This only works on strings:
`a ; b`: evaluate a, discard its result, then evaluate b. Returns the result of b. `a ; b`: evaluate a, discard its result, then evaluate b. Returns the result of b.
`a;`: evaluate a, discard its result, returns nil.
`a : b`: evaluate a and b, returns a new pair with a as key and b as value. `a : b`: evaluate a and b, returns a new pair with a as key and b as value.
`a :: b`: evaluate a and b, returns a new typed value with a as value and b as type. `a :: b`: evaluate a and b, returns a new typed value with a as value and b as type.

View file

@ -46,6 +46,7 @@ common = {
"_^_", "_^_",
"_._", "_!_", "_._", "_!_",
-- suffix unop -- suffix unop
"_;",
"_!", "_!",
-- special -- special
"()", "()",

View file

@ -31,7 +31,7 @@ local prefix_unops_prio = {
[12] = { "&" } [12] = { "&" }
} }
local suffix_unops_prio = { local suffix_unops_prio = {
[1] = {}, [1] = { ";" },
[2] = {}, [2] = {},
[3] = {}, [3] = {},
[4] = {}, [4] = {},

View file

@ -7,6 +7,10 @@ lua_functions = {
mode = "raw", mode = "raw",
value = function(a, b) return b end value = function(a, b) return b end
}, },
["_;(a)"] = {
mode = "raw",
value = function(a) return { type = "nil", value = nil } end
},
-- comparaison -- comparaison
["_==_(a, b)"] = { ["_==_(a, b)"] = {
mode = "raw", mode = "raw",