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

Exported variables: no longer add export scope to every function, allow freely access and modifiy variable in function scope

Too many issues with predefining exported variables, and this is more flexible.
This commit is contained in:
Étienne Fildadut 2023-12-30 23:43:05 +01:00
parent 0eea4b80a6
commit 2cd910389b
14 changed files with 65 additions and 73 deletions

View file

@ -21,6 +21,12 @@ local common = {
:gsub("N", math.random(0x8, 0xb)) -- variant 1
:gsub("x", function() return ("%x"):format(math.random(0x0, 0xf)) end) -- random hexadecimal digit
end,
-- same as assert, but do not add position information
-- useful for errors raised from anselme (don't care about Lua error position)
assert0 = function(v, message, ...)
if not v then error(message, 0) end
return v, message, ...
end,
-- list of operators and their priority that are handled through regular function calls & can be overloaded/etc. by the user
regular_operators = {
prefixes = {