Clean out oldast (#14837)

* Clean out old Deprecated CLI switch
* Update to remove --oldast CLI option
This commit is contained in:
Juan Carlos 2020-06-30 05:01:25 -03:00 • committed by GitHub
commit 74d1f25010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 25 deletions

View file

@ -220,6 +220,7 @@ proc mydiv(a, b): int {.raises: [].} =
See [docgen](docgen.html#introduction-quick-start) for details. See [docgen](docgen.html#introduction-quick-start) for details.
- Removed the `--oldNewlines` switch. - Removed the `--oldNewlines` switch.
- Removed the `--laxStrings` switch for mutating the internal zero terminator on strings. - 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" - `$getType(untyped)` is now "untyped" instead of "expr", `$getType(typed)` is now "typed" instead of "stmt"

View file

@ -320,7 +320,6 @@ proc testCompileOption*(conf: ConfigRef; switch: string, info: TLineInfo): bool
of "patterns", "trmacros": result = contains(conf.options, optTrMacros) of "patterns", "trmacros": result = contains(conf.options, optTrMacros)
of "excessivestacktrace": result = contains(conf.globalOptions, optExcessiveStackTrace) of "excessivestacktrace": result = contains(conf.globalOptions, optExcessiveStackTrace)
of "nilseqs": result = contains(conf.options, optNilSeqs) of "nilseqs": result = contains(conf.options, optNilSeqs)
of "oldast": result = contains(conf.options, optOldAst)
else: invalidCmdLineOption(conf, passCmd1, switch, info) else: invalidCmdLineOption(conf, passCmd1, switch, info)
proc processPath(conf: ConfigRef; path: string, info: TLineInfo, 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, "hotcodereloading")
undefSymbol(conf.symbols, "useNimRtl") undefSymbol(conf.symbols, "useNimRtl")
of "nilseqs": processOnOffSwitch(conf, {optNilSeqs}, arg, pass, info) 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 "checks", "x": processOnOffSwitch(conf, ChecksOptions, arg, pass, info)
of "floatchecks": of "floatchecks":
processOnOffSwitch(conf, {optNaNCheck, optInfCheck}, arg, pass, info) processOnOffSwitch(conf, {optNaNCheck, optInfCheck}, arg, pass, info)

View file

@ -40,7 +40,6 @@ type # please make sure we have under 32 options
optTrMacros, # en/disable pattern matching optTrMacros, # en/disable pattern matching
optMemTracker, optMemTracker,
optNilSeqs, optNilSeqs,
optOldAst,
optSinkInference # 'sink T' inference optSinkInference # 'sink T' inference

View file

@ -586,10 +586,6 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
b.add a[^2] b.add a[^2]
b.add copyTree(def) b.add copyTree(def)
addToVarSection(c, result, n, b) addToVarSection(c, result, n, b)
if optOldAst in c.config.options:
if def.kind != nkEmpty:
v.ast = def
else:
# this is needed for the evaluation pass, guard checking # this is needed for the evaluation pass, guard checking
# and custom pragmas: # and custom pragmas:
var ast = newNodeI(nkIdentDefs, a.info) var ast = newNodeI(nkIdentDefs, a.info)

View file

@ -510,9 +510,6 @@ proc extractPragma(s: PSym): PNode =
proc warnAboutDeprecated(conf: ConfigRef; info: TLineInfo; s: PSym) = proc warnAboutDeprecated(conf: ConfigRef; info: TLineInfo; s: PSym) =
var pragmaNode: PNode 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 = let name =
if s.kind == skEnumField and sfDeprecated notin s.flags: "enum '" & s.owner.name.s & "' which contains field '" & s.name.s & "'" if s.kind == skEnumField and sfDeprecated notin s.flags: "enum '" & s.owner.name.s & "' which contains field '" & s.name.s & "'"

View file

@ -314,7 +314,6 @@ tcc.options.always = "-w"
@if nimv019: @if nimv019:
--multimethods:on --multimethods:on
--oldAst:on
--define:nimOldCaseObjects --define:nimOldCaseObjects
--define:nimOldShiftRight --define:nimOldShiftRight
@end @end

View file

@ -105,7 +105,6 @@ Advanced options:
backwards compatibility backwards compatibility
--seqsv2:on|off use the new string/seq implementation based on --seqsv2:on|off use the new string/seq implementation based on
destructors destructors
--oldast:on|off use old AST for backwards compatibility
--skipCfg:on|off do not read the nim installation's configuration file --skipCfg:on|off do not read the nim installation's configuration file
--skipUserCfg:on|off do not read the user'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 --skipParentCfg:on|off do not read the parent dirs' configuration files