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

Changed a few things

* Integrated # and ~ decorators into the expression system. Created associated operators.
* # and ~ decorators only affect their current line. That's more useful...
* Fix our priority system to evaluate left-to-right instead of right-to-left (if there was a reason why I did it this way initially, I don't remember it so ¯\_(ツ)_/¯)
* a lotta internal changes

Various other small adjustments, see the diff of REFERENCE.md for details.
This commit is contained in:
Étienne Fildadut 2021-11-28 01:43:54 +01:00
parent 14d348bad9
commit f2e74c94c9
31 changed files with 894 additions and 343 deletions

View file

@ -325,18 +325,8 @@ local function transform_indented(indented)
if l.content:match("^%(") then
table.remove(indented, i)
else
-- condition decorator
if l.content:match("^.-[^~]%~[^#~$]-$") then
local decorator
l.content, decorator = l.content:match("^(..-)(%~[^#~$]-)$")
indented[i] = { content = decorator, source = l.source, children = { l } }
-- tag decorator
elseif l.content:match("^..-%#[^#~$]-$") then
local decorator
l.content, decorator = l.content:match("^(..-)(%#[^#~$]-)$")
indented[i] = { content = decorator, source = l.source, children = { l } }
-- function decorator
elseif l.content:match("^..-%$[^#~$]-$") then
if l.content:match("^.-[^\\]%$[^#~$]-$") then -- FIXME
local name
l.content, name = l.content:match("^(..-)%$([^#~$]-)$")
indented[i] = { content = "~"..name, source = l.source }