closes #7117
This commit is contained in:
parent
085fbcea6f
commit
9aad99bdfd
1 changed files with 16 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ bar7
|
||||||
10
|
10
|
||||||
4true
|
4true
|
||||||
132
|
132
|
||||||
|
20
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -192,7 +193,7 @@ block ttempl:
|
||||||
|
|
||||||
|
|
||||||
block ttempl4:
|
block ttempl4:
|
||||||
template `:=`(name, val: untyped): typed =
|
template `:=`(name, val: untyped) =
|
||||||
var name = val
|
var name = val
|
||||||
|
|
||||||
ha := 1 * 4
|
ha := 1 * 4
|
||||||
|
|
@ -211,7 +212,7 @@ block ttempl5:
|
||||||
discard
|
discard
|
||||||
|
|
||||||
# Call parse_to_close
|
# Call parse_to_close
|
||||||
template get_next_ident: typed =
|
template get_next_ident =
|
||||||
discard "{something}".parse_to_close(0, open = '{', close = '}')
|
discard "{something}".parse_to_close(0, open = '{', close = '}')
|
||||||
|
|
||||||
get_next_ident()
|
get_next_ident()
|
||||||
|
|
@ -231,3 +232,16 @@ block ttempl5:
|
||||||
block templreturntype:
|
block templreturntype:
|
||||||
template `=~` (a: int, b: int): bool = false
|
template `=~` (a: int, b: int): bool = false
|
||||||
var foo = 2 =~ 3
|
var foo = 2 =~ 3
|
||||||
|
|
||||||
|
# bug #7117
|
||||||
|
template parse9(body: untyped): untyped =
|
||||||
|
|
||||||
|
template val9(arg: string): int {.inject.} =
|
||||||
|
var b: bool
|
||||||
|
if b: 10
|
||||||
|
else: 20
|
||||||
|
|
||||||
|
body
|
||||||
|
|
||||||
|
parse9:
|
||||||
|
echo val9("1")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue