diff options
Diffstat (limited to 'examples/talk/dsl.nim')
-rw-r--r-- | examples/talk/dsl.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/examples/talk/dsl.nim b/examples/talk/dsl.nim index 1034c99d4..2dde51790 100644 --- a/examples/talk/dsl.nim +++ b/examples/talk/dsl.nim @@ -1,20 +1,20 @@ import strutils -template html(name: expr, matter: stmt) {.immediate.} = +template html(name, matter: untyped) = proc name(): string = result = "<html>" matter result.add("</html>") -template nestedTag(tag: expr) {.immediate.} = - template tag(matter: stmt) {.immediate.} = +template nestedTag(tag: untyped) = + template tag(matter: typed) = result.add("<" & astToStr(tag) & ">") matter result.add("</" & astToStr(tag) & ">") -template simpleTag(tag: expr) {.immediate.} = - template tag(matter: expr) {.immediate.} = +template simpleTag(tag: untyped) = + template tag(matter: untyped) = result.add("<$1>$2</$1>" % [astToStr(tag), matter]) nestedTag body |