diff options
author | Dominik Picheta <dominikpicheta@googlemail.com> | 2021-10-13 10:09:45 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-13 11:09:45 +0200 |
commit | 2aa97a228aa3a34b48f1af9901f29379fb131a31 (patch) | |
tree | ad0e2d5b43c70bd1a54d5bd216b2c33873283c5b /tests/pragmas | |
parent | 0ae2d1ea88fdc7b6910ddbc960c7db086be383e4 (diff) | |
download | Nim-2aa97a228aa3a34b48f1af9901f29379fb131a31.tar.gz |
Removes deprecated {.injectStmt.}. Fixes #18666 (#18984)
Diffstat (limited to 'tests/pragmas')
-rw-r--r-- | tests/pragmas/tinjectstmt.nim | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/tests/pragmas/tinjectstmt.nim b/tests/pragmas/tinjectstmt.nim deleted file mode 100644 index c6256bda6..000000000 --- a/tests/pragmas/tinjectstmt.nim +++ /dev/null @@ -1,51 +0,0 @@ -discard """ - joinable: false - output:''' -onInject: 1 -onInject: 2 -ok0 -ok1 -onInject: 3 -onInject: 4 -onInject: 5 -0 -onInject: 6 -onInject: 7 -onInject: 8 -1 -onInject: 9 -onInject: 10 -onInject: 11 -2 -ok2 -onInject: 12 -''' -""" - -# test {.injectStmt.} - -#[ -{.injectStmt.} pragma can be used to inject a statement before every -other statement in the current module. It's now undocumented and may be removed -in the future and replaced with something more general and without its limitations. -(e.g. doesn't work in VM or js backends). -]# - -from system/ansi_c import c_printf - -var count = 0 -proc onInject*() = - count.inc - # echo count # xxx would fail, probably infinite recursion - c_printf("onInject: %d\n", cast[int](count)) - -{.injectStmt: onInject().} -echo "ok0" -proc main()= - echo "ok1" - for a in 0..<3: - echo a - echo "ok2" - -static: main() # xxx injectStmt not honored in VM -main() |