diff options
author | Juan Carlos <juancarlospaco@gmail.com> | 2020-06-30 05:01:25 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 10:01:25 +0200 |
commit | 74d1f2501023805dadca75e402e70ef73a1d5bf7 (patch) | |
tree | a095cc0aa110c42c85e26b42cc9d6fb5f9ebe440 /compiler | |
parent | 5c1fa142d64f866d5e9531a4ba542e64d73fc8c8 (diff) | |
download | Nim-74d1f2501023805dadca75e402e70ef73a1d5bf7.tar.gz |
Clean out oldast (#14837)
* Clean out old Deprecated CLI switch * Update to remove --oldast CLI option
Diffstat (limited to 'compiler')
-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 |
4 files changed, 13 insertions, 23 deletions
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 |