mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
Add while loop line and operator
This commit is contained in:
parent
f5382d2912
commit
48cabbf4c0
14 changed files with 500 additions and 61 deletions
|
|
@ -29,11 +29,17 @@ local function parse_line(line, state, namespace)
|
|||
local r = {
|
||||
source = line.source
|
||||
}
|
||||
-- else-condition & condition
|
||||
if l:match("^~~?") then
|
||||
r.type = l:match("^~~") and "else-condition" or "condition"
|
||||
-- else-condition, condition & while
|
||||
if l:match("^~[~%?]?") then
|
||||
if l:match("^~~") then
|
||||
r.type = "else-condition"
|
||||
elseif l:match("^~%?") then
|
||||
r.type = "while"
|
||||
else
|
||||
r.type = "condition"
|
||||
end
|
||||
r.child = true
|
||||
local expr = l:match("^~~?(.*)$")
|
||||
local expr = l:match("^~[~%?]?(.*)$")
|
||||
if expr:match("[^%s]") then
|
||||
r.expression = expr
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue