Remove expr/stmt (#5857)
This commit is contained in:
parent
52ff244d5d
commit
000b8afd26
168 changed files with 497 additions and 529 deletions
|
|
@ -126,7 +126,7 @@ iterator parse_compound_statements(value, identifier: string, index: int): strin
|
|||
## and returns the initialization of each as an empty statement
|
||||
## i.e. if x == 5 { ... } becomes if x == 5: nil.
|
||||
|
||||
template get_next_ident(expected): stmt =
|
||||
template get_next_ident(expected) =
|
||||
var nextIdent: string
|
||||
discard value.parseWhile(nextIdent, {'$'} + identChars, i)
|
||||
|
||||
|
|
@ -316,10 +316,10 @@ proc parse_template(node: NimNode, value: string) =
|
|||
## Nim code into the input `node` AST.
|
||||
var index = 0
|
||||
while index < value.len and
|
||||
parse_until_symbol(node, value, index): nil
|
||||
parse_until_symbol(node, value, index): discard
|
||||
|
||||
|
||||
macro tmpli*(body: expr): stmt =
|
||||
macro tmpli*(body: untyped): untyped =
|
||||
result = newStmtList()
|
||||
|
||||
result.add parseExpr("result = \"\"")
|
||||
|
|
@ -330,7 +330,7 @@ macro tmpli*(body: expr): stmt =
|
|||
parse_template(result, reindent(value))
|
||||
|
||||
|
||||
macro tmpl*(body: expr): stmt =
|
||||
macro tmpl*(body: untyped): untyped =
|
||||
result = newStmtList()
|
||||
|
||||
var value = if body.kind in nnkStrLit..nnkTripleStrLit: body.strVal
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue