Created
July 25, 2019 06:40
-
-
Save DarkWiiPlayer/48f1249a639c6ffa9161822a57956597 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function element(name) | |
return function(tab) | |
return function() | |
print('<'..name..'>') | |
if type(tab) == 'table' then | |
for key, value in ipairs(tab) do | |
value() | |
end | |
elseif type(tab) == 'string' then | |
print(tab) | |
end | |
print('</'..name..'>') | |
end | |
end | |
end | |
local function text(content) | |
return function() | |
print(content) | |
end | |
end | |
local template = | |
element 'html' { | |
element 'head' { | |
text 'Hello World!' | |
} | |
} | |
template() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment