Clean out oldast (#14837)
* Clean out old Deprecated CLI switch * Update to remove --oldast CLI option
This commit is contained in:
parent
5c1fa142d6
commit
74d1f25010
7 changed files with 14 additions and 25 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue