Showing with 1,317 additions and 1,063 deletions.
  1. +2 −0 .travis.yml
  2. +1 −1 azure-pipelines.yml
  3. +56 −0 changelogs/changelog_1_0_2.md
  4. +75 −0 changelogs/changelog_1_0_4.md
  5. +0 −4 compiler/ast.nim
  6. +7 −6 compiler/ccgexprs.nim
  7. +4 −4 compiler/ccgstmts.nim
  8. +3 −2 compiler/ccgtrav.nim
  9. +1 −1 compiler/ccgtypes.nim
  10. +1 −1 compiler/cgen.nim
  11. +18 −15 compiler/commands.nim
  12. +0 −72 compiler/cursors.nim
  13. +1 −1 compiler/docgen.nim
  14. +2 −2 compiler/evalffi.nim
  15. +14 −13 compiler/extccomp.nim
  16. +2 −0 compiler/gorgeimpl.nim
  17. +1 −1 compiler/guards.nim
  18. +4 −0 compiler/importer.nim
  19. +257 −482 compiler/injectdestructors.nim
  20. +18 −4 compiler/int128.nim
  21. +5 −2 compiler/jsgen.nim
  22. +37 −32 compiler/lambdalifting.nim
  23. +3 −3 compiler/liftdestructors.nim
  24. +7 −1 compiler/nimconf.nim
  25. +13 −2 compiler/options.nim
  26. +3 −18 compiler/pragmas.nim
  27. +3 −3 compiler/scriptconfig.nim
  28. +17 −2 compiler/semdata.nim
  29. +1 −1 compiler/semexprs.nim
  30. +2 −4 compiler/semfold.nim
  31. +1 −1 compiler/semobjconstr.nim
  32. +10 −5 compiler/semstmts.nim
  33. +3 −3 compiler/semtypes.nim
  34. +15 −7 compiler/sigmatch.nim
  35. +1 −1 compiler/spawn.nim
  36. +1 −2 compiler/transf.nim
  37. +2 −1 compiler/vm.nim
  38. +2 −0 compiler/vmdeps.nim
  39. +56 −25 compiler/vmgen.nim
  40. +5 −1 compiler/vmops.nim
  41. +0 −4 compiler/wordrecg.nim
  42. +1 −0 doc/advopt.txt
  43. +4 −4 doc/astspec.txt
  44. +28 −27 doc/backends.rst
  45. +4 −4 doc/contributing.rst
  46. +16 −14 doc/docgen.rst
  47. +5 −4 doc/gc.rst
  48. +5 −4 doc/idetools.rst
  49. +88 −0 doc/intern.rst
  50. +4 −3 doc/koch.rst
  51. +6 −5 doc/lib.rst
  52. +44 −22 doc/manual.rst
  53. +5 −4 doc/manual_experimental.rst
  54. +7 −14 doc/nimc.rst
  55. +3 −3 doc/nimsuggest.rst
  56. +3 −0 doc/packaging.rst
  57. +1 −1 doc/sets_fragment.txt
  58. +1 −1 doc/tools.rst
  59. +43 −41 doc/tut1.rst
  60. +1 −1 doc/tut3.rst
  61. +30 −10 lib/core/macros.nim
  62. +1 −1 lib/experimental/diff.nim
  63. +1 −1 lib/impure/nre.nim
  64. +1 −1 lib/js/dom.nim
  65. +1 −1 lib/js/jsconsole.nim
  66. +2 −2 lib/nimhcr.nim
  67. +1 −1 lib/packages/docutils/rst.nim
  68. +13 −9 lib/packages/docutils/rstgen.nim
  69. +1 −1 lib/posix/posix.nim
  70. +1 −1 lib/posix/posix_macos_amd64.nim
  71. +1 −1 lib/posix/posix_other.nim
  72. +1 −1 lib/pure/algorithm.nim
  73. +1 −1 lib/pure/asyncstreams.nim
  74. +2 −2 lib/pure/base64.nim
  75. +1 −1 lib/pure/bitops.nim
  76. +2 −2 lib/pure/collections/lists.nim
  77. +3 −3 lib/pure/collections/sequtils.nim
  78. +5 −5 lib/pure/collections/sets.nim
  79. +3 −2 lib/pure/collections/tables.nim
  80. +4 −4 lib/pure/colors.nim
  81. +3 −0 lib/pure/complex.nim
  82. +1 −1 lib/pure/concurrency/threadpool.nim
  83. +1 −1 lib/pure/distros.nim
  84. +1 −1 lib/pure/encodings.nim
  85. +5 −1 lib/pure/htmlgen.nim
  86. +1 −1 lib/pure/json.nim
  87. +4 −2 lib/pure/math.nim
  88. +6 −6 lib/pure/memfiles.nim
  89. +7 −2 lib/pure/os.nim
  90. +1 −1 lib/pure/parsecfg.nim
  91. +3 −3 lib/pure/parsecsv.nim
  92. +6 −6 lib/pure/parseopt.nim
  93. +1 −1 lib/pure/random.nim
  94. +1 −1 lib/pure/streams.nim
  95. +29 −28 lib/pure/strutils.nim
  96. +1 −1 lib/pure/times.nim
  97. +2 −1 lib/std/monotimes.nim
  98. +3 −3 lib/std/sha1.nim
  99. +36 −21 lib/system.nim
  100. +1 −1 lib/system/assertions.nim
  101. +6 −0 lib/system/excpt.nim
  102. +1 −1 lib/system/gc_regions.nim
  103. +4 −0 lib/system/inclrtl.nim
  104. +2 −2 lib/system/io.nim
  105. +5 −4 lib/system/nimscript.nim
  106. +3 −3 lib/system/sets.nim
  107. +2 −2 lib/system/sysstr.nim
  108. +1 −1 lib/wrappers/iup.nim
  109. +1 −1 lib/wrappers/mysql.nim
  110. +1 −1 lib/wrappers/openssl.nim
  111. +14 −5 testament/important_packages.nim
  112. +9 −0 testament/specs.nim
  113. +11 −7 testament/testament.nim
  114. +8 −0 tests/array/tarray.nim
  115. +10 −0 tests/compiler/tcmdlinecpuamd64.nim
  116. +1 −0 tests/compiler/tcmdlinecpuamd64.nim.cfg
  117. +14 −0 tests/compiler/tcmdlineoswin.nim
  118. +1 −0 tests/compiler/tcmdlineoswin.nim.cfg
  119. +2 −1 tests/dll/nimhcr_integration.nim
  120. +1 −1 tests/gc/gcbench.nim
  121. +14 −0 tests/generics/tgeneric0.nim
  122. +20 −0 tests/js/t12223.nim
  123. +1 −1 tests/manyloc/keineschweine/dependencies/genpacket/genpacket_enet.nim
  124. +1 −1 tests/misc/tunsignedconv.nim
  125. +1 −1 tests/objvariant/tadrdisc.nim
  126. +1 −0 tests/objvariant/tfloatrangeobj.nim
  127. +17 −16 tests/objvariant/trt_discrim.nim
  128. +2 −2 tests/objvariant/trt_discrim_err2.nim
  129. +17 −0 tests/pragmas/twarning_off.nim
  130. +7 −0 tests/pragmas/warn_module.nim
  131. +2 −2 tests/tuples/tuple_with_nil.nim
  132. +6 −0 tests/valgrind/tbasic_valgrind.nim
  133. +20 −0 tests/vm/tmisc_vm.nim
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ addons:
- libsdl1.2-dev
- libgc-dev
- libsfml-dev
- libc6-dbg
- valgrind
homebrew:
packages:
- boehmgc
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ steps:
sudo apt-fast update -qq
DEBIAN_FRONTEND='noninteractive' \
sudo apt-fast install --no-install-recommends -yq \
libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev
libcurl4-openssl-dev libgc-dev libsdl1.2-dev libsfml-dev valgrind libc6-dbg
displayName: 'Install dependencies (amd64 Linux)'
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64'))
Expand Down
56 changes: 56 additions & 0 deletions changelogs/changelog_1_0_2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# v1.0.2 - 2019-10-23


## Bugfixes

* fixes the --verbosity:2 regression
* Fixed "Fail to compile a file twice under Windows (v1.0 bug)." [#12242](https://github.com/nim-lang/Nim/issues/12242)
* fix nimpretty removing space before pragma
* JS: gensym is stricter for 'this'
* Fixed "VM Assertion Error with newruntime" [#12294](https://github.com/nim-lang/Nim/issues/12294)
* Fixed "Assertion error when running `nim check` on compiler/nim.nim" [#12281](https://github.com/nim-lang/Nim/issues/12281)
* Fixed "Compiler crash with empty array and generic instantiation with int as parameter" [#12264](https://github.com/nim-lang/Nim/issues/12264)
* Fixed "Regression in JS backend codegen "Error: request to generate code for .compileTime proc"" [#12240](https://github.com/nim-lang/Nim/issues/12240)
* Fix how `relativePath` handle case sensitiviy
* Fixed "SIGSEGV in compiler when using generic types and seqs" [#12336](https://github.com/nim-lang/Nim/issues/12336)
* Fixed "[1.0.0] weird interaction between `import os` and casting integer to char on macosx trigger bad codegen" [#12291](https://github.com/nim-lang/Nim/issues/12291)
* VM: no special casing for big endian machines
* Fixed "`internal error: environment misses` with a simple template inside one of Jester macros" [#12323](https://github.com/nim-lang/Nim/issues/12323)
* nimsuggest: fix tcp socket leak
* nimsuggest: fix tcp socket leak for epc backend
* Fixed "`writeFile` and `write(f, str)` skip null bytes on Windows" [#12315](https://github.com/nim-lang/Nim/issues/12315)
* Fixed "Crash in intsets symmetric_difference" [#12366](https://github.com/nim-lang/Nim/issues/12366)
* Fixed "[regression] VM crash when dealing with var param of a proc result" [#12244](https://github.com/nim-lang/Nim/issues/12244)
* fixes a koch regression that made 'koch boot --listcmd' not work anymore
* Fixed "[regression] inconsistent signed int `mod` operator between runtime, compiletime, and semfold" [#12332](https://github.com/nim-lang/Nim/issues/12332)
* Fixed "Boehm disables interior pointer checking" [#12286](https://github.com/nim-lang/Nim/issues/12286)
* Fixes semCustomPragma when nkSym
* Fixed yield in nkCheckedFieldExpr
* Fixed "`randomize()` from `random` not working on JS" [#12418](https://github.com/nim-lang/Nim/issues/12418)
* Fixed "Compiler crash with invalid object variant" [#12379](https://github.com/nim-lang/Nim/issues/12379)
* fix type's case in random.nim
* Fixed "Update docs with a better way to signal unimplemented methods" [#10804](https://github.com/nim-lang/Nim/issues/10804)
* Fixed "Nim language manual, push pragma is not explained well" [#10824](https://github.com/nim-lang/Nim/issues/10824)
* Fixed "[regression] Importing more than one module with same name from different packages produce bad codegen" [#12420](https://github.com/nim-lang/Nim/issues/12420)
* Namespace unittest enums to avoid name conflicts
* Fixed "VM checks unsigned integers for overflow." [#12310](https://github.com/nim-lang/Nim/issues/12310)
* Fixed "line directive is not generated for first line of function definition" [#12426](https://github.com/nim-lang/Nim/issues/12426)



## Documentation improvements

* threadpool: fix link in docs (#12258)
* Fix spellings (#12277)
* fix #12278, don't expose internal PCRE documentation
* Fixed "Documentation of quitprocs is wrong" [#12279](https://github.com/nim-lang/Nim/issues/12279)
* Fix typo in docs
* Fix reference to parseSpec proc in readme
* [doc/tut1] removed discard discussion in comments
* Documentation improvements around the db interface
* Easier build instructions for windows - just run `build_all.bat`.
* fix a few dead links and a missing sentence in documentation
* Macro docs additions
* Updated the code example in the os module to use better grammar.
* Mention "lambdas" and `=>` in the manual
* Better documentation on Garbage Collector
75 changes: 75 additions & 0 deletions changelogs/changelog_1_0_4.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# v1.0.4 - 2019-11-26



## Language changes

- Conversions to unsigned integers are unchecked at runtime, imitating earlier Nim
versions. The documentation was improved to acknowledge this special case.
See https://github.com/nim-lang/RFCs/issues/175 for more details. (#12688)

- Add `or detectOs(Manjaro)` (#12587)

- --os:ios needs to imply defined(macosx) (#12585)

- export nim.cfg parser (#12602)



## Bugfixes

- Fixed "gorge(Ex) fails after a few calls on OSX"
([#12337](https://github.com/nim-lang/Nim/issues/12337))
- Fixed "Improve posix module"
([#10723](https://github.com/nim-lang/Nim/issues/10723))
- Fixed "nim check allows gorgeEx but doesn't allow writeFile"
([#12491](https://github.com/nim-lang/Nim/issues/12491))
- Fixed "Low level arithmetics bug: -3 mod 7 == 3"
([#12514](https://github.com/nim-lang/Nim/issues/12514))
- Fixed "Broken link to c2nim in backends.rst/.html"
([#12537](https://github.com/nim-lang/Nim/issues/12537))
- Fixed "generic argument with default value causes incorrect generic type resolution"
([#12528](https://github.com/nim-lang/Nim/issues/12528))
- Fixed "regression: compiler/vmgen.nim(354, 20) `false` leaking temporary 10 slotTempInt [AssertionError]
([#12547](https://github.com/nim-lang/Nim/issues/12547))
- Fixed "Compile/link broken for nim (64-bit only) on Windows"
([#12536](https://github.com/nim-lang/Nim/issues/12536))
- Fixed "No `=destroy` for elements of closure environments other than for latest devel --gc:destructors"
([#12577](https://github.com/nim-lang/Nim/issues/12577))
- Fixed "[1.0.0] Cannot compile anything with --cpu:avr"
([#12395](https://github.com/nim-lang/Nim/issues/12395))
- Fixed "Compiler crash with invalid object variant"
([#12379](https://github.com/nim-lang/Nim/issues/12379))
- Fixed "push pragma is silently ignored if position is in front of import statement"
([#5050](https://github.com/nim-lang/Nim/issues/5050))
- Fixed "Error with strformat + asyncdispatch + const"
([#12612](https://github.com/nim-lang/Nim/issues/12612))
- Fixed "The --nimblePath is additive; need a pain-free workaround"
([#12601](https://github.com/nim-lang/Nim/issues/12601))
- Fixed "nim.cfg syntax for --define:FOO:VAL undocumented or absent"
([#12367](https://github.com/nim-lang/Nim/issues/12367))
- Fixed "vm string literals do not work when generated by a macro"
([#12670](https://github.com/nim-lang/Nim/issues/12670))
- Fixed "StaticRead does force a recompile if static file changes."
([#12663](https://github.com/nim-lang/Nim/issues/12663))
- Fixed crash in terminate handler
([#12572](https://github.com/nim-lang/Nim/pull/12572))
- Fixed newLit for objects having string fields
([#12542](https://github.com/nim-lang/Nim/pull/12542))



## Documentation improvements

- Documentation Math module (#12460)
- Fix many broken links and prefer relative links within docs (#12463)
- sequtils: replace deprecated 'random' call within example (#12515)
- integer literal documentation (#12513)
- Fix code style errors (#12545)
- fix several typos in documentation and comments (#12553)
- Add docs to better distinguish among getProjectPath, getCurrentDir and currentSourcePath (#12565)
- doc/tut3.rst: Fix typo in Introduction (#12607)
- Add links to packaging and distro pages (#12603)
- fix documentation of `$`\*(dt: DateTime) (#12660)
- Clarifies experimental / parallel example on manual.rst (#12472)
- Fix wrong section hierarchy in the manual (#12724)
4 changes: 0 additions & 4 deletions compiler/ast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,6 @@ type
const
sfNoInit* = sfMainModule # don't generate code to init the variable

sfCursor* = sfDispatcher
# local variable has been computed to be a "cursor".
# see cursors.nim for details about what that means.

sfAllUntyped* = sfVolatile # macro or template is immediately expanded \
# in a generic context

Expand Down
13 changes: 7 additions & 6 deletions compiler/ccgexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ proc rawGenNew(p: BProc, a: TLoc, sizeExpr: Rope) =
if sizeExpr.isNil:
sizeExpr = "sizeof($1)" % [getTypeDesc(p.module, bt)]

if optNimV2 in p.config.globalOptions:
if optOwnedRefs in p.config.globalOptions:
b.r = ropecg(p.module, "($1) #nimNewObj($2)",
[getTypeDesc(p.module, typ), sizeExpr])
genAssignment(p, a, b, {})
Expand Down Expand Up @@ -1484,7 +1484,7 @@ proc genNewFinalize(p: BProc, e: PNode) =
gcUsage(p.config, e)

proc genOfHelper(p: BProc; dest: PType; a: Rope; info: TLineInfo): Rope =
if optNimV2 in p.config.globalOptions:
if optTinyRtti in p.config.globalOptions:
result = ropecg(p.module, "#isObj($1.m_type, $2)",
[a, genTypeInfo2Name(p.module, dest)])
else:
Expand Down Expand Up @@ -1535,7 +1535,7 @@ proc genOf(p: BProc, n: PNode, d: var TLoc) =
genOf(p, n.sons[1], n.sons[2].typ, d)

proc genRepr(p: BProc, e: PNode, d: var TLoc) =
if optNimV2 in p.config.globalOptions:
if optTinyRtti in p.config.globalOptions:
localError(p.config, e.info, "'repr' is not available for --newruntime")
var a: TLoc
initLocExpr(p, e.sons[1], a)
Expand Down Expand Up @@ -1931,7 +1931,8 @@ proc genCast(p: BProc, e: PNode, d: var TLoc) =
proc genRangeChck(p: BProc, n: PNode, d: var TLoc, magic: string) =
var a: TLoc
var dest = skipTypes(n.typ, abstractVar)
if optRangeCheck notin p.options:
if optRangeCheck notin p.options or (dest.kind in {tyUInt..tyUInt64} and
checkUnsignedConversions notin p.config.legacyFeatures):
initLocExpr(p, n.sons[0], a)
putIntoDest(p, d, n, "(($1) ($2))" %
[getTypeDesc(p.module, dest), rdCharLoc(a)], a.storage)
Expand Down Expand Up @@ -2148,7 +2149,7 @@ proc genMagicExpr(p: BProc, e: PNode, d: var TLoc, op: TMagic) =
of mCStrToStr: genDollar(p, e, d, "#cstrToNimstr($1)")
of mStrToStr, mUnown: expr(p, e.sons[1], d)
of mEnumToStr:
if optNimV2 in p.config.globalOptions:
if optTinyRtti in p.config.globalOptions:
genEnumToStr(p, e, d)
else:
genRepr(p, e, d)
Expand Down Expand Up @@ -2423,7 +2424,7 @@ proc upConv(p: BProc, n: PNode, d: var TLoc) =
while t.kind == tyObject and t.sons[0] != nil:
add(r, ".Sup")
t = skipTypes(t.sons[0], skipPtrs)
let checkFor = if optNimV2 in p.config.globalOptions:
let checkFor = if optTinyRtti in p.config.globalOptions:
genTypeInfo2Name(p.module, dest)
else:
genTypeInfo(p.module, dest, n.info)
Expand Down
8 changes: 4 additions & 4 deletions compiler/ccgstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const

proc getTraverseProc(p: BProc, v: PSym): Rope =
if p.config.selectedGC in {gcMarkAndSweep, gcDestructors, gcV2, gcRefc} and
optNimV2 notin p.config.globalOptions and
optOwnedRefs notin p.config.globalOptions and
containsGarbageCollectedRef(v.loc.t):
# we register a specialized marked proc here; this has the advantage
# that it works out of the box for thread local storage then :-)
Expand Down Expand Up @@ -692,7 +692,7 @@ proc genRaiseStmt(p: BProc, t: PNode) =
[e, makeCString(typ.sym.name.s),
makeCString(if p.prc != nil: p.prc.name.s else: p.module.module.name.s),
quotedFilename(p.config, t.info), toLinenumber(t.info)])
if optNimV2 in p.config.globalOptions:
if optOwnedRefs in p.config.globalOptions:
lineCg(p, cpsStmts, "$1 = NIM_NIL;$n", [e])
else:
genLineDir(p, t)
Expand Down Expand Up @@ -1057,7 +1057,7 @@ proc genTry(p: BProc, t: PNode, d: var TLoc) =
for j in 0 .. blen - 2:
assert(t.sons[i].sons[j].kind == nkType)
if orExpr != nil: add(orExpr, "||")
let checkFor = if optNimV2 in p.config.globalOptions:
let checkFor = if optTinyRtti in p.config.globalOptions:
genTypeInfo2Name(p.module, t[i][j].typ)
else:
genTypeInfo(p.module, t[i][j].typ, t[i][j].info)
Expand Down Expand Up @@ -1220,7 +1220,7 @@ proc asgnFieldDiscriminant(p: BProc, e: PNode) =
getTemp(p, a.t, tmp)
expr(p, e.sons[1], tmp)
let field = dotExpr.sons[1].sym
if optNimV2 in p.config.globalOptions:
if optTinyRtti in p.config.globalOptions:
let t = dotExpr[0].typ.skipTypes(abstractInst)
var oldVal, newVal: TLoc
genCaseObjDiscMapping(p, e[0], t, field, oldVal)
Expand Down
5 changes: 3 additions & 2 deletions compiler/ccgtrav.nim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type
visitorFrmt: string

const
visitorFrmt = "#nimGCvisit((void*)$1, $2);$n"
visitorFrmt = "#nimGCvisit((void*)$1, $2);$n"

proc genTraverseProc(c: TTraversalClosure, accessor: Rope, typ: PType)
proc genCaseRange(p: BProc, branch: PNode)
Expand Down Expand Up @@ -104,7 +104,8 @@ proc genTraverseProc(c: TTraversalClosure, accessor: Rope, typ: PType) =
elif containsGarbageCollectedRef(typ.lastSon):
# destructor based seqs are themselves not traced but their data is, if
# they contain a GC'ed type:
genTraverseProcSeq(c, accessor, typ)
lineCg(p, cpsStmts, "#nimGCvisitSeq((void*)$1, $2);$n", [accessor, c.visitorFrmt])
#genTraverseProcSeq(c, accessor, typ)
of tyString:
if tfHasAsgn notin typ.flags:
lineCg(p, cpsStmts, visitorFrmt, [accessor, c.visitorFrmt])
Expand Down
2 changes: 1 addition & 1 deletion compiler/ccgtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,7 @@ proc genTypeInfo(m: BModule, t: PType; info: TLineInfo): Rope =
of tySet: genSetInfo(m, t, result, info)
of tyEnum: genEnumInfo(m, t, result, info)
of tyObject:
if optNimV2 in m.config.globalOptions:
if optTinyRtti in m.config.globalOptions:
genObjectInfoV2(m, t, origType, result, info)
else:
genObjectInfo(m, t, origType, result, info)
Expand Down
2 changes: 1 addition & 1 deletion compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ proc genObjectInit(p: BProc, section: TCProcSection, t: PType, a: TLoc,
s = skipTypes(s.sons[0], skipPtrs)
linefmt(p, section, "$1.m_type = $2;$n", [r, genTypeInfo(p.module, t, a.lode.info)])
of frEmbedded:
if optNimV2 in p.config.globalOptions:
if optTinyRtti in p.config.globalOptions:
localError(p.config, p.prc.info,
"complex object initialization is not supported with --newruntime")
# worst case for performance:
Expand Down
33 changes: 18 additions & 15 deletions compiler/commands.nim
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,9 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
of "nonimblepath", "nobabelpath":
expectNoArg(conf, switch, arg, pass, info)
disableNimblePath(conf)
of "clearnimblepath":
expectNoArg(conf, switch, arg, pass, info)
clearNimblePath(conf)
of "excludepath":
expectArg(conf, switch, arg, pass, info)
let path = processPath(conf, arg, info)
Expand Down Expand Up @@ -614,22 +617,20 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
processOnOffSwitchG(conf, {optGenMapping}, arg, pass, info)
of "os":
expectArg(conf, switch, arg, pass, info)
if pass in {passCmd1, passPP}:
let theOS = platform.nameToOS(arg)
if theOS == osNone:
let osList = platform.listOSnames().join(", ")
localError(conf, info, "unknown OS: '$1'. Available options are: $2" % [arg, $osList])
elif theOS != conf.target.hostOS:
setTarget(conf.target, theOS, conf.target.targetCPU)
let theOS = platform.nameToOS(arg)
if theOS == osNone:
let osList = platform.listOSnames().join(", ")
localError(conf, info, "unknown OS: '$1'. Available options are: $2" % [arg, $osList])
else:
setTarget(conf.target, theOS, conf.target.targetCPU)
of "cpu":
expectArg(conf, switch, arg, pass, info)
if pass in {passCmd1, passPP}:
let cpu = platform.nameToCPU(arg)
if cpu == cpuNone:
let cpuList = platform.listCPUnames().join(", ")
localError(conf, info, "unknown CPU: '$1'. Available options are: $2" % [ arg, cpuList])
elif cpu != conf.target.hostCPU:
setTarget(conf.target, conf.target.targetOS, cpu)
let cpu = platform.nameToCPU(arg)
if cpu == cpuNone:
let cpuList = platform.listCPUnames().join(", ")
localError(conf, info, "unknown CPU: '$1'. Available options are: $2" % [ arg, cpuList])
else:
setTarget(conf.target, conf.target.targetOS, cpu)
of "run", "r":
processOnOffSwitchG(conf, {optRun}, arg, pass, info)
of "errormax":
Expand Down Expand Up @@ -758,7 +759,9 @@ proc processSwitch*(switch, arg: string, pass: TCmdLinePass, info: TLineInfo;
if pass in {passCmd2, passPP}:
doAssert(conf != nil)
incl(conf.features, destructor)
incl(conf.globalOptions, optNimV2)
incl(conf.globalOptions, optTinyRtti)
incl(conf.globalOptions, optOwnedRefs)
incl(conf.globalOptions, optSeqDestructors)
defineSymbol(conf.symbols, "nimV2")
conf.selectedGC = gcDestructors
defineSymbol(conf.symbols, "gcdestructors")
Expand Down
Loading