diff options
-rw-r--r-- | changelog.md | 1 | ||||
-rw-r--r-- | compiler/commands.nim | 2 | ||||
-rw-r--r-- | compiler/options.nim | 1 | ||||
-rw-r--r-- | compiler/semstmts.nim | 28 | ||||
-rw-r--r-- | compiler/suggest.nim | 5 | ||||
-rw-r--r-- | config/nim.cfg | 1 | ||||
-rw-r--r-- | doc/advopt.txt | 1 |
7 files changed, 14 insertions, 25 deletions
diff --git a/changelog.md b/changelog.md index d5f3c8aa9..2d9a78d3b 100644 --- a/changelog.md +++ b/changelog.md @@ -220,6 +220,7 @@ proc mydiv(a, b): int {.raises: [].} = See [docgen](docgen.html#introduction-quick-start) for details. - Removed the `--oldNewlines` switch. - Removed the `--laxStrings` switch for mutating the internal zero terminator on strings. +- Removed the `--oldast` switch. - `$getType(untyped)` is now "untyped" instead of "expr", `$getType(typed)` is now "typed" instead of "stmt" diff --git a/compiler/commands.nim b/compiler/commands.nim index fc559d68c..95df45ebe 100644 --- a/compiler/commands.nim +++ b/compiler/commands.nim @@ -320,7 +320,6 @@ proc testCompileOption*(conf: ConfigRef; switch: string, info: TLineInfo): bool of "patterns", "trmacros": result = contains(conf.options, optTrMacros) of "excessivestacktrace": result = contains(conf.globalOptions, optExcessiveStackTrace) of "nilseqs": result = contains(conf.options, optNilSeqs) - of "oldast": result = contains(conf.options, optOldAst) else: invalidCmdLineOption(conf, passCmd1, switch, info) proc processPath(conf: ConfigRef; path: string, info: TLineInfo, @@ -583,7 +582,6 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo; undefSymbol(conf.symbols, "hotcodereloading") undefSymbol(conf.symbols, "useNimRtl") of "nilseqs": processOnOffSwitch(conf, {optNilSeqs}, arg, pass, info) - of "oldast": processOnOffSwitch(conf, {optOldAst}, arg, pass, info) of "checks", "x": processOnOffSwitch(conf, ChecksOptions, arg, pass, info) of "floatchecks": processOnOffSwitch(conf, {optNaNCheck, optInfCheck}, arg, pass, info) diff --git a/compiler/options.nim b/compiler/options.nim index 92c664587..abec038ed 100644 --- a/compiler/options.nim +++ b/compiler/options.nim @@ -40,7 +40,6 @@ type # please make sure we have under 32 options optTrMacros, # en/disable pattern matching optMemTracker, optNilSeqs, - optOldAst, optSinkInference # 'sink T' inference diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 47a5130af..a2515357b 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -586,23 +586,19 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode = b.add a[^2] b.add copyTree(def) addToVarSection(c, result, n, b) - if optOldAst in c.config.options: - if def.kind != nkEmpty: - v.ast = def + # this is needed for the evaluation pass, guard checking + # and custom pragmas: + var ast = newNodeI(nkIdentDefs, a.info) + if a[j].kind == nkPragmaExpr: + var p = newNodeI(nkPragmaExpr, a.info) + p.add newSymNode(v) + p.add a[j][1].copyTree + ast.add p else: - # this is needed for the evaluation pass, guard checking - # and custom pragmas: - var ast = newNodeI(nkIdentDefs, a.info) - if a[j].kind == nkPragmaExpr: - var p = newNodeI(nkPragmaExpr, a.info) - p.add newSymNode(v) - p.add a[j][1].copyTree - ast.add p - else: - ast.add newSymNode(v) - ast.add a[^2].copyTree - ast.add def - v.ast = ast + ast.add newSymNode(v) + ast.add a[^2].copyTree + ast.add def + v.ast = ast else: if def.kind in {nkPar, nkTupleConstr}: v.ast = def[j] # bug #7663, for 'nim check' this can be a non-tuple: diff --git a/compiler/suggest.nim b/compiler/suggest.nim index 58b54cc03..a9f248fb9 100644 --- a/compiler/suggest.nim +++ b/compiler/suggest.nim @@ -510,10 +510,7 @@ proc extractPragma(s: PSym): PNode = proc warnAboutDeprecated(conf: ConfigRef; info: TLineInfo; s: PSym) = var pragmaNode: PNode - if optOldAst in conf.options and s.kind in {skVar, skLet}: - pragmaNode = nil - else: - pragmaNode = if s.kind == skEnumField: extractPragma(s.owner) else: extractPragma(s) + pragmaNode = if s.kind == skEnumField: extractPragma(s.owner) else: extractPragma(s) let name = if s.kind == skEnumField and sfDeprecated notin s.flags: "enum '" & s.owner.name.s & "' which contains field '" & s.name.s & "'" else: s.name.s diff --git a/config/nim.cfg b/config/nim.cfg index 206f80413..c888fcf89 100644 --- a/config/nim.cfg +++ b/config/nim.cfg @@ -314,7 +314,6 @@ tcc.options.always = "-w" @if nimv019: --multimethods:on - --oldAst:on --define:nimOldCaseObjects --define:nimOldShiftRight @end diff --git a/doc/advopt.txt b/doc/advopt.txt index 588d4eece..f5b8c9ec9 100644 --- a/doc/advopt.txt +++ b/doc/advopt.txt @@ -105,7 +105,6 @@ Advanced options: backwards compatibility --seqsv2:on|off use the new string/seq implementation based on destructors - --oldast:on|off use old AST for backwards compatibility --skipCfg:on|off do not read the nim installation's configuration file --skipUserCfg:on|off do not read the user's configuration file --skipParentCfg:on|off do not read the parent dirs' configuration files |