diff options
Diffstat (limited to 'compiler/pragmas.nim')
-rw-r--r-- | compiler/pragmas.nim | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index b548837fe..8e639f083 100644 --- a/compiler/pragmas.nim +++ b/compiler/pragmas.nim @@ -45,7 +45,7 @@ const wBreakpoint, wWatchPoint, wPassl, wPassc, wDeadCodeElim, wDeprecated, wFloatchecks, wInfChecks, wNanChecks, wPragma, wEmit, wUnroll, wLinearScanEnd, wPatterns, wEffects, wNoForward, wComputedGoto, - wInjectStmt, wDeprecated} + wInjectStmt, wDeprecated, wExperimental} lambdaPragmas* = {FirstCallConv..LastCallConv, wImportc, wExportc, wNodecl, wNosideeffect, wSideeffect, wNoreturn, wDynlib, wHeader, wDeprecated, wExtern, wThread, wImportCpp, wImportObjC, wAsmNoStackFrame, @@ -357,11 +357,11 @@ proc processPush(c: PContext, n: PNode, start: int) = append(c.optionStack, x) for i in countup(start, sonsLen(n) - 1): if processOption(c, n.sons[i]): - # simply store it somehwere: + # simply store it somewhere: if x.otherPragmas.isNil: x.otherPragmas = newNodeI(nkPragma, n.info) x.otherPragmas.add n.sons[i] - #LocalError(n.info, errOptionExpected) + #localError(n.info, errOptionExpected) proc processPop(c: PContext, n: PNode) = if c.optionStack.counter <= 1: @@ -850,6 +850,12 @@ proc singlePragma(c: PContext, sym: PSym, n: PNode, i: int, localError(it.info, errExprExpected) else: it.sons[1] = c.semExpr(c, it.sons[1]) + of wExperimental: + noVal(it) + if isTopLevel(c): + c.module.flags.incl sfExperimental + else: + localError(it.info, "'experimental' pragma only valid as toplevel statement") else: invalidPragma(it) else: invalidPragma(it) else: processNote(c, it) |