mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 00:59:31 +00:00
Improve function decorator parsing
This commit is contained in:
parent
f2e74c94c9
commit
38b2a6ae69
7 changed files with 57 additions and 104 deletions
|
|
@ -326,9 +326,9 @@ local function transform_indented(indented)
|
|||
table.remove(indented, i)
|
||||
else
|
||||
-- function decorator
|
||||
if l.content:match("^.-[^\\]%$[^#~$]-$") then -- FIXME
|
||||
if l.content:match("^.-[^\\]%$"..identifier_pattern.."$") then
|
||||
local name
|
||||
l.content, name = l.content:match("^(..-)%$([^#~$]-)$")
|
||||
l.content, name = l.content:match("^(.-[^\\])%$("..identifier_pattern..")$")
|
||||
indented[i] = { content = "~"..name, source = l.source }
|
||||
table.insert(indented, i+1, { content = "$"..name, source = l.source, children = { l } })
|
||||
i = i + 1 -- $ line should not contain any decorator anymore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue