Make useVersion:1.0 disable the proc arg sym change (#15570)
* Make useVersion:1.0 disable the proc arg sym change * Also do this for useVersion:1.2
This commit is contained in:
parent
8978112457
commit
977bccdbff
4 changed files with 13 additions and 2 deletions
|
|
@ -248,7 +248,10 @@
|
||||||
```
|
```
|
||||||
- `getImpl` on enum type symbols now returns field syms instead of idents. This helps
|
- `getImpl` on enum type symbols now returns field syms instead of idents. This helps
|
||||||
with writing typed macros. Old behavior for backwards compatibility can be restored
|
with writing typed macros. Old behavior for backwards compatibility can be restored
|
||||||
with command line switch `--useVersion:1.0`.
|
with `--useVersion:1.0`.
|
||||||
|
- The typed AST for proc headers will now have the arguments be syms instead of idents.
|
||||||
|
This helps with writing typed macros. Old behaviour for backwards compatibility can
|
||||||
|
be restored with `--useVersion:1.0`.
|
||||||
- ``let`` statements can now be used without a value if declared with
|
- ``let`` statements can now be used without a value if declared with
|
||||||
``importc``/``importcpp``/``importjs``/``importobjc``.
|
``importc``/``importcpp``/``importjs``/``importobjc``.
|
||||||
- The keyword `from` is now usable as an operator.
|
- The keyword `from` is now usable as an operator.
|
||||||
|
|
|
||||||
|
|
@ -883,6 +883,12 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
|
||||||
undefSymbol(conf.symbols, "nimDoesntTrackDefects")
|
undefSymbol(conf.symbols, "nimDoesntTrackDefects")
|
||||||
ast.eqTypeFlags.excl {tfGcSafe, tfNoSideEffect}
|
ast.eqTypeFlags.excl {tfGcSafe, tfNoSideEffect}
|
||||||
conf.globalOptions.incl optNimV1Emulation
|
conf.globalOptions.incl optNimV1Emulation
|
||||||
|
of "1.2":
|
||||||
|
defineSymbol(conf.symbols, "NimMajor", "1")
|
||||||
|
defineSymbol(conf.symbols, "NimMinor", "2")
|
||||||
|
# always be compatible with 1.2.100:
|
||||||
|
defineSymbol(conf.symbols, "NimPatch", "100")
|
||||||
|
conf.globalOptions.incl optNimV12Emulation
|
||||||
else:
|
else:
|
||||||
localError(conf, info, "unknown Nim version; currently supported values are: {1.0}")
|
localError(conf, info, "unknown Nim version; currently supported values are: {1.0}")
|
||||||
of "benchmarkvm":
|
of "benchmarkvm":
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ type # please make sure we have under 32 options
|
||||||
optProduceAsm # produce assembler code
|
optProduceAsm # produce assembler code
|
||||||
optPanics # turn panics (sysFatal) into a process termination
|
optPanics # turn panics (sysFatal) into a process termination
|
||||||
optNimV1Emulation # emulate Nim v1.0
|
optNimV1Emulation # emulate Nim v1.0
|
||||||
|
optNimV12Emulation # emulate Nim v1.2
|
||||||
optSourcemap
|
optSourcemap
|
||||||
optProfileVM # enable VM profiler
|
optProfileVM # enable VM profiler
|
||||||
optEnableDeepCopy # ORC specific: enable 'deepcopy' for all types.
|
optEnableDeepCopy # ORC specific: enable 'deepcopy' for all types.
|
||||||
|
|
|
||||||
|
|
@ -1288,7 +1288,8 @@ proc semProcTypeNode(c: PContext, n, genericParams: PNode,
|
||||||
addParamOrResult(c, arg, kind)
|
addParamOrResult(c, arg, kind)
|
||||||
styleCheckDef(c.config, a[j].info, arg)
|
styleCheckDef(c.config, a[j].info, arg)
|
||||||
onDef(a[j].info, arg)
|
onDef(a[j].info, arg)
|
||||||
a[j] = newSymNode(arg)
|
if {optNimV1Emulation, optNimV12Emulation} * c.config.globalOptions == {}:
|
||||||
|
a[j] = newSymNode(arg)
|
||||||
|
|
||||||
var r: PType
|
var r: PType
|
||||||
if n[0].kind != nkEmpty:
|
if n[0].kind != nkEmpty:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue