diff options
author | Arne Döring <arne.doering@gmx.net> | 2017-07-25 09:28:23 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-07-25 09:28:23 +0200 |
commit | 000b8afd26fa16684a116d9afe798ea94df9c270 (patch) | |
tree | e5295df748b90c5027e44adfa3a442031534572c /tests/closure | |
parent | 52ff244d5d2775fa4d13f4e2b9a996f411281312 (diff) | |
download | Nim-000b8afd26fa16684a116d9afe798ea94df9c270.tar.gz |
Remove expr/stmt (#5857)
Diffstat (limited to 'tests/closure')
-rw-r--r-- | tests/closure/tmacrobust1512.nim | 182 |
1 files changed, 91 insertions, 91 deletions
diff --git a/tests/closure/tmacrobust1512.nim b/tests/closure/tmacrobust1512.nim index 95681e750..5f13e8286 100644 --- a/tests/closure/tmacrobust1512.nim +++ b/tests/closure/tmacrobust1512.nim @@ -2,109 +2,109 @@ import macros, strutils # https://github.com/nim-lang/Nim/issues/1512 -proc macrobust0 (raw_input: string) = +proc macrobust0(raw_input: string) = var output = "" - proc p1 (a:string) = - output.add (a) - - proc p2 (a:string) = p1 (a) - proc p3 (a:string) = p2 (a) - proc p4 (a:string) = p3 (a) - proc p5 (a:string) = p4 (a) - proc p6 (a:string) = p5 (a) - proc p7 (a:string) = p6 (a) - proc p8 (a:string) = p7 (a) - proc p9 (a:string) = p8 (a) - proc p10 (a:string) = p9 (a) - proc p11 (a:string) = p10 (a) - proc p12 (a:string) = p11 (a) - proc p13 (a:string) = p12 (a) - proc p14 (a:string) = p13 (a) - proc p15 (a:string) = p14 (a) - proc p16 (a:string) = p15 (a) - proc p17 (a:string) = p16 (a) - proc p18 (a:string) = p17 (a) - proc p19 (a:string) = p18 (a) - proc p20 (a:string) = p19 (a) + proc p1(a:string) = + output.add(a) + + proc p2(a:string) = p1(a) + proc p3(a:string) = p2(a) + proc p4(a:string) = p3(a) + proc p5(a:string) = p4(a) + proc p6(a:string) = p5(a) + proc p7(a:string) = p6(a) + proc p8(a:string) = p7(a) + proc p9(a:string) = p8(a) + proc p10(a:string) = p9(a) + proc p11(a:string) = p10(a) + proc p12(a:string) = p11(a) + proc p13(a:string) = p12(a) + proc p14(a:string) = p13(a) + proc p15(a:string) = p14(a) + proc p16(a:string) = p15(a) + proc p17(a:string) = p16(a) + proc p18(a:string) = p17(a) + proc p19(a:string) = p18(a) + proc p20(a:string) = p19(a) let input = $raw_input - for a in input.split (): - p20 (a) - p19 (a) - - - p18 (a) - p17 (a) - p16 (a) - p15 (a) - p14 (a) - p13 (a) - p12 (a) - p11 (a) - p10 (a) - p9 (a) - p8 (a) - p7 (a) - p6 (a) - p5 (a) - p4 (a) - p3 (a) - p2 (a) - p1 (a) + for a in input.split(): + p20(a) + p19(a) + + + p18(a) + p17(a) + p16(a) + p15(a) + p14(a) + p13(a) + p12(a) + p11(a) + p10(a) + p9(a) + p8(a) + p7(a) + p6(a) + p5(a) + p4(a) + p3(a) + p2(a) + p1(a) echo output -macro macrobust (raw_input: expr) : stmt = +macro macrobust(raw_input: untyped): untyped = var output = "" - proc p1 (a:string) = - output.add (a) - - proc p2 (a:string) = p1 (a) - proc p3 (a:string) = p2 (a) - proc p4 (a:string) = p3 (a) - proc p5 (a:string) = p4 (a) - proc p6 (a:string) = p5 (a) - proc p7 (a:string) = p6 (a) - proc p8 (a:string) = p7 (a) - proc p9 (a:string) = p8 (a) - proc p10 (a:string) = p9 (a) - proc p11 (a:string) = p10 (a) - proc p12 (a:string) = p11 (a) - proc p13 (a:string) = p12 (a) - proc p14 (a:string) = p13 (a) - proc p15 (a:string) = p14 (a) - proc p16 (a:string) = p15 (a) - proc p17 (a:string) = p16 (a) - proc p18 (a:string) = p17 (a) - proc p19 (a:string) = p18 (a) - proc p20 (a:string) = p19 (a) + proc p1(a:string) = + output.add(a) + + proc p2(a:string) = p1(a) + proc p3(a:string) = p2(a) + proc p4(a:string) = p3(a) + proc p5(a:string) = p4(a) + proc p6(a:string) = p5(a) + proc p7(a:string) = p6(a) + proc p8(a:string) = p7(a) + proc p9(a:string) = p8(a) + proc p10(a:string) = p9(a) + proc p11(a:string) = p10(a) + proc p12(a:string) = p11(a) + proc p13(a:string) = p12(a) + proc p14(a:string) = p13(a) + proc p15(a:string) = p14(a) + proc p16(a:string) = p15(a) + proc p17(a:string) = p16(a) + proc p18(a:string) = p17(a) + proc p19(a:string) = p18(a) + proc p20(a:string) = p19(a) let input = $raw_input - for a in input.split (): - p20 (a) - p19 (a) - - p18 (a) - p17 (a) - p16 (a) - p15 (a) - p14 (a) - p13 (a) - p12 (a) - p11 (a) - p10 (a) - p9 (a) - p8 (a) - p7 (a) - p6 (a) - p5 (a) - p4 (a) - p3 (a) - p2 (a) + for a in input.split(): + p20(a) + p19(a) + + p18(a) + p17(a) + p16(a) + p15(a) + p14(a) + p13(a) + p12(a) + p11(a) + p10(a) + p9(a) + p8(a) + p7(a) + p6(a) + p5(a) + p4(a) + p3(a) + p2(a) echo output discard result @@ -134,4 +134,4 @@ macrobust0 """ sdafsdaffsda sdfasadfsadf fsdasdafsdfa sdfasdfafsda sdfasdafsadf sdfasdafsdaf sdfasdafsdaf -""" \ No newline at end of file +""" |