parameter passing works the same for macros and templates; use callsite magic to access the invokation AST
This commit is contained in:
parent
6bcdb9c8f4
commit
b4844a189d
16 changed files with 270 additions and 180 deletions
|
|
@ -262,12 +262,13 @@ macro `<>`*(x: expr): expr =
|
|||
## Constructor macro for XML. Example usage:
|
||||
##
|
||||
## .. code-block:: nimrod
|
||||
## <>a(href="http://force7.de/nimrod", "Nimrod rules.")
|
||||
## <>a(href="http://nimrod-code.org", "Nimrod rules.")
|
||||
##
|
||||
## Produces an XML tree for::
|
||||
##
|
||||
## <a href="http://force7.de/nimrod">Nimrod rules.</a>
|
||||
## <a href="http://nimrod-code.org">Nimrod rules.</a>
|
||||
##
|
||||
let x = callsite()
|
||||
result = xmlConstructor(x)
|
||||
|
||||
proc child*(n: PXmlNode, name: string): PXmlNode =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue