New {.experimental: "ForLoopMacros".} support (#62)

* Bug https://github.com/nim-lang/Nim/issues/8676 and da41fc1801

* Use a commandline flag
This commit is contained in:
Mamy Ratsimbazafy 2018-08-20 10:34:28 +02:00 committed by GitHub
parent 215293756a
commit fc27e86061
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 3 deletions

1
nim.cfg Normal file
View File

@ -0,0 +1 @@
--experimental:ForLoopMacros

View File

@ -12,8 +12,6 @@ import ./datatypes, ./conversion, macros
# ######################################################################### # #########################################################################
# Multi-precision ints to compile-time array of words # Multi-precision ints to compile-time array of words
{.experimental: "ForLoopMacros".}
proc asWordsImpl(x: NimNode, current_path: NimNode, result: var NimNode) = proc asWordsImpl(x: NimNode, current_path: NimNode, result: var NimNode) =
## Transforms an UintImpl/IntImpl into an array of words ## Transforms an UintImpl/IntImpl into an array of words
## at compile-time. Recursive implementation. ## at compile-time. Recursive implementation.

View File

@ -9,7 +9,6 @@
import ./datatypes, ./as_words import ./datatypes, ./as_words
func `not`*(x: UintImpl): UintImpl {.inline.}= func `not`*(x: UintImpl): UintImpl {.inline.}=
## Bitwise complement of unsigned integer x ## Bitwise complement of unsigned integer x
for wr, wx in asWords(result, x): for wr, wx in asWords(result, x):