lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Asko wrote:
One could have a special syntactic format of declaring 'sub-chunks',
solving all the above issues at once. Maybe this could even be done
as a tkn fltr ;) --not saying the word, i bet there's already people
fltering out such posts!--

thread @[[
    local a,b,c= ...
    -- ...
    return xx
]]

mlp.lexer:add{ "@[[", "]]" }
mlp.expr:add{ "@[[", mlp.block, "]]", builder = |x| `Call{ `Id "thread", mlc.bin_of_ast (x[1]) } }

That's it :)
(this is some metalua 0.3 code, compiler yet unreleased due to unupdated doc)