mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 04:14:19 +00:00
put the new for loop macros under an experimental switch named 'forLoopMacros'
This commit is contained in:
@@ -111,14 +111,16 @@ type
|
||||
ideNone, ideSug, ideCon, ideDef, ideUse, ideDus, ideChk, ideMod,
|
||||
ideHighlight, ideOutline, ideKnown, ideMsg
|
||||
|
||||
Feature* = enum ## experimental features
|
||||
Feature* = enum ## experimental features; DO NOT RENAME THESE!
|
||||
implicitDeref,
|
||||
dotOperators,
|
||||
callOperator,
|
||||
parallel,
|
||||
destructor,
|
||||
notnil,
|
||||
dynamicBindSym
|
||||
dynamicBindSym,
|
||||
forLoopMacros
|
||||
#caseStmtMacros
|
||||
|
||||
SymbolFilesOption* = enum
|
||||
disabledSf, writeOnlySf, readOnlySf, v2Sf
|
||||
|
||||
@@ -720,8 +720,9 @@ proc handleForLoopMacro(c: PContext; n: PNode): PNode =
|
||||
proc semFor(c: PContext, n: PNode): PNode =
|
||||
checkMinSonsLen(n, 3, c.config)
|
||||
var length = sonsLen(n)
|
||||
result = handleForLoopMacro(c, n)
|
||||
if result != nil: return result
|
||||
if forLoopMacros in c.features:
|
||||
result = handleForLoopMacro(c, n)
|
||||
if result != nil: return result
|
||||
openScope(c)
|
||||
result = n
|
||||
n.sons[length-2] = semExprNoDeref(c, n.sons[length-2], {efWantIterator})
|
||||
|
||||
Reference in New Issue
Block a user