transformed {.reorder: on.} into {.experimental: codeReordering.}, added tests

This commit is contained in:
awr
2018-09-04 15:31:38 -05:00
parent 1d93991929
commit e6a4213fae
5 changed files with 24 additions and 12 deletions

View File

@@ -2,7 +2,8 @@ discard """
disabled: true
"""
{. noforward: on .}
# {. noforward: on .}
{.experimental: "codeReordering".}
proc foo(x: int) =
bar x

View File

@@ -6,7 +6,8 @@ output:'''0
"""
import macros
{.reorder: on .}
# {.reorder: on .}
{.experimental: "codeReordering".}
echo foo(-1)
echo callWithFoo(0)
@@ -71,4 +72,4 @@ macro make(arg: untyped): untyped =
proc first(i: int): void =
make(second)
var ss {.compileTime.}: string = ""
var ss {.compileTime.}: string = ""

View File

@@ -0,0 +1,12 @@
discard """
output:'''false'''
"""
{.experimental: "codeReordering".}
proc x() =
echo(declared(foo))
var foo = 4
x() # "false", the same as it would be with code reordering OFF