Showing with 2,585 additions and 1,968 deletions.
  1. +148 −0 azure-pipelines.yml
  2. +16 −0 build_all.bat
  3. +1 −1 compiler/asciitables.nim
  4. +5 −5 compiler/ast.nim
  5. +1 −1 compiler/ccgexprs.nim
  6. +1 −1 compiler/ccgstmts.nim
  7. +2 −1 compiler/ccgtypes.nim
  8. +7 −6 compiler/cgen.nim
  9. +2 −2 compiler/cgendata.nim
  10. +5 −4 compiler/closureiters.nim
  11. +1 −1 compiler/cmdlinehelper.nim
  12. +1 −1 compiler/dfa.nim
  13. +1 −1 compiler/evaltempl.nim
  14. +2 −2 compiler/extccomp.nim
  15. +1 −1 compiler/filter_tmpl.nim
  16. +1 −1 compiler/hlo.nim
  17. +1 −1 compiler/importer.nim
  18. +2 −2 compiler/injectdestructors.nim
  19. +19 −1 compiler/int128.nim
  20. +9 −1 compiler/jsgen.nim
  21. +3 −1 compiler/lambdalifting.nim
  22. +2 −1 compiler/layouter.nim
  23. +1 −1 compiler/lexer.nim
  24. +1 −1 compiler/lookups.nim
  25. +2 −2 compiler/modulegraphs.nim
  26. +1 −1 compiler/nimeval.nim
  27. +1 −1 compiler/nimfix/nimfix.nim
  28. +1 −1 compiler/nversion.nim
  29. +2 −2 compiler/options.nim
  30. +7 −10 compiler/packagehandling.nim
  31. +1 −1 compiler/parser.nim
  32. +1 −1 compiler/pragmas.nim
  33. +2 −2 compiler/procfind.nim
  34. +1 −1 compiler/semcall.nim
  35. +1 −1 compiler/semexprs.nim
  36. +1 −1 compiler/seminst.nim
  37. +1 −1 compiler/semmagic.nim
  38. +1 −1 compiler/semobjconstr.nim
  39. +4 −2 compiler/sempass2.nim
  40. +6 −0 compiler/semtypes.nim
  41. +4 −4 compiler/semtypinst.nim
  42. +7 −6 compiler/sizealignoffsetimpl.nim
  43. +2 −2 compiler/transf.nim
  44. +3 −6 compiler/types.nim
  45. +12 −16 compiler/vm.nim
  46. +7 −4 compiler/vmgen.nim
  47. +1 −1 compiler/vmops.nim
  48. +27 −3 doc/gc.rst
  49. +0 −3 doc/lib.rst
  50. +25 −4 doc/manual.rst
  51. +0 −9 doc/tut1.rst
  52. +8 −4 koch.nim
  53. +141 −124 lib/core/macros.nim
  54. +1 −1 lib/deprecated/pure/LockFreeHash.nim
  55. +1 −1 lib/deprecated/pure/parseopt2.nim
  56. +3 −3 lib/experimental/diff.nim
  57. +2 −2 lib/impure/db_odbc.nim
  58. +1 −1 lib/impure/db_postgres.nim
  59. +12 −0 lib/impure/db_sqlite.nim
  60. +1 −1 lib/impure/nre.nim
  61. +1 −1 lib/js/jsffi.nim
  62. +2 −2 lib/packages/docutils/rstgen.nim
  63. +1 −1 lib/posix/posix.nim
  64. +1 −1 lib/posix/posix_utils.nim
  65. +49 −40 lib/pure/algorithm.nim
  66. +10 −10 lib/pure/asyncdispatch.nim
  67. +1 −1 lib/pure/asyncfile.nim
  68. +14 −14 lib/pure/asyncftpclient.nim
  69. +8 −8 lib/pure/asyncfutures.nim
  70. +5 −4 lib/pure/asynchttpserver.nim
  71. +11 −9 lib/pure/asyncmacro.nim
  72. +8 −7 lib/pure/asyncnet.nim
  73. +6 −6 lib/pure/asyncstreams.nim
  74. +5 −4 lib/pure/base64.nim
  75. +48 −33 lib/pure/bitops.nim
  76. +1 −1 lib/pure/browsers.nim
  77. +5 −5 lib/pure/cgi.nim
  78. +17 −0 lib/pure/collections/intsets.nim
  79. +2 −2 lib/pure/collections/sequtils.nim
  80. +21 −21 lib/pure/complex.nim
  81. +1 −1 lib/pure/concurrency/atomics.nim
  82. +1 −1 lib/pure/concurrency/cpuinfo.nim
  83. +1 −1 lib/pure/concurrency/threadpool.nim
  84. +23 −16 lib/pure/coro.nim
  85. +53 −53 lib/pure/db_common.nim
  86. +10 −8 lib/pure/distros.nim
  87. +6 −6 lib/pure/dynlib.nim
  88. +165 −159 lib/pure/encodings.nim
  89. +3 −3 lib/pure/endians.nim
  90. +21 −21 lib/pure/fenv.nim
  91. +4 −4 lib/pure/hashes.nim
  92. +5 −5 lib/pure/htmlgen.nim
  93. +4 −3 lib/pure/htmlparser.nim
  94. +14 −13 lib/pure/httpclient.nim
  95. +19 −19 lib/pure/httpcore.nim
  96. +29 −24 lib/pure/json.nim
  97. +1 −1 lib/pure/lenientops.nim
  98. +11 −11 lib/pure/lexbase.nim
  99. +25 −23 lib/pure/logging.nim
  100. +1 −1 lib/pure/marshal.nim
  101. +33 −27 lib/pure/math.nim
  102. +2 −1 lib/pure/md5.nim
  103. +33 −31 lib/pure/memfiles.nim
  104. +2 −1 lib/pure/mersenne.nim
  105. +1 −1 lib/pure/mimetypes.nim
  106. +52 −48 lib/pure/nativesockets.nim
  107. +36 −31 lib/pure/net.nim
  108. +2 −1 lib/pure/nimprof.nim
  109. +3 −2 lib/pure/oids.nim
  110. +3 −2 lib/pure/options.nim
  111. +18 −17 lib/pure/os.nim
  112. +81 −93 lib/pure/osproc.nim
  113. +10 −9 lib/pure/oswalkdir.nim
  114. +26 −26 lib/pure/parsecfg.nim
  115. +7 −7 lib/pure/parsecsv.nim
  116. +26 −26 lib/pure/parsejson.nim
  117. +18 −15 lib/pure/parseopt.nim
  118. +27 −25 lib/pure/parsesql.nim
  119. +21 −21 lib/pure/parseutils.nim
  120. +42 −40 lib/pure/parsexml.nim
  121. +2 −1 lib/pure/pathnorm.nim
  122. +81 −80 lib/pure/pegs.nim
  123. +1 −1 lib/pure/punycode.nim
  124. +30 −30 lib/pure/random.nim
  125. +48 −47 lib/pure/rationals.nim
  126. +20 −16 lib/pure/reservedmem.nim
  127. +9 −9 lib/pure/ropes.nim
  128. +1 −1 lib/pure/segfaults.nim
  129. +2 −2 lib/pure/selectors.nim
  130. +5 −5 lib/pure/smtp.nim
  131. +16 −16 lib/pure/stats.nim
  132. +9 −7 lib/pure/streams.nim
  133. +22 −17 lib/pure/strformat.nim
  134. +1 −1 lib/pure/strmisc.nim
  135. +30 −18 lib/pure/strscans.nim
  136. +27 −25 lib/pure/strtabs.nim
  137. +113 −95 lib/pure/strutils.nim
  138. +75 −73 lib/pure/terminal.nim
  139. +92 −78 lib/pure/times.nim
  140. +34 −33 lib/pure/unicode.nim
  141. +48 −37 lib/pure/unittest.nim
  142. +12 −9 lib/pure/uri.nim
  143. +3 −2 lib/pure/xmlparser.nim
  144. +15 −13 lib/pure/xmltree.nim
  145. +1 −1 lib/std/editdistance.nim
  146. +9 −9 lib/system.nim
  147. +1 −1 lib/system/gc.nim
  148. +1 −1 lib/system/gc2.nim
  149. +9 −3 lib/system/io.nim
  150. +4 −2 lib/system/mmdisp.nim
  151. +20 −20 lib/wrappers/pcre.nim
  152. +1 −1 lib/wrappers/sqlite3.nim
  153. +1 −1 nimpretty/tests/expected/tevil_spaces.nim
  154. +1 −1 nimpretty/tests/tevil_spaces.nim
  155. +3 −3 nimsuggest/nimsuggest.nim
  156. +1 −1 nimsuggest/tester.nim
  157. +7 −16 readme.md
  158. +95 −0 testament/azure.nim
  159. +1 −1 testament/categories.nim
  160. +1 −0 testament/important_packages.nim
  161. +3 −0 testament/specs.nim
  162. +23 −10 testament/testament.nim
  163. +1 −0 testament/testament.nim.cfg
  164. +1 −1 tests/assert/tfailedassert.nim
  165. +2 −2 tests/astspec/tastspec.nim
  166. +10 −0 tests/async/tasync_misc.nim
  167. +1 −0 tests/async/tasyncclosestall.nim
  168. +1 −1 tests/async/tasyncdial.nim
  169. +1 −1 tests/casestmt/tcasestmt.nim
  170. +1 −1 tests/compilerapi/exposed.nim
  171. +1 −1 tests/converter/tgenericconverter2.nim
  172. +1 −1 tests/cpp/tcovariancerules.nim
  173. +5 −4 tests/float/tfloatrange.nim
  174. +1 −1 tests/macros/tmacro3.nim
  175. +1 −1 tests/macros/ttemplatesymbols.nim
  176. +4 −4 tests/manyloc/keineschweine/dependencies/chipmunk/chipmunk.nim
  177. +1 −1 tests/manyloc/keineschweine/server/sg_lobby.nim
  178. +1 −1 tests/metatype/ttypeselectors.nim
  179. +1 −1 tests/mmaptest.nim
  180. +2 −0 tests/modules/a/utils.nim
  181. +2 −0 tests/modules/b/utils.nim
  182. +5 −0 tests/modules/tutils_ab.nim
  183. +1 −1 tests/notnil/tnotnil_in_objconstr.nim
  184. +1 −1 tests/objects/tobject3.nim
  185. +1 −1 tests/readme.md
  186. +1 −1 tests/stdlib/tgetfileinfo.nim
  187. +1 −2 tests/stdlib/thttpclient.nim
  188. +1 −1 tests/stdlib/tjsonmacro.nim
  189. +4 −0 tests/stdlib/tos.nim
  190. +1 −1 tests/stdlib/tosproc.nim
  191. +1 −1 tests/stdlib/trepr2.nim
  192. +2 −2 tests/stdlib/ttimes.nim
  193. +1 −4 tests/system/t7894.nim
  194. +17 −3 tests/system/techo_unicode.nim
  195. +1 −1 tests/template/t_otemplates.nim
  196. +2 −2 tests/tuples/tuple_with_nil.nim
  197. +3 −0 tests/untestable/gdb/gdb_pretty_printer_test.py
  198. +1 −1 tests/vm/tcastint.nim
  199. +34 −0 tests/vm/tmisc_vm.nim
  200. +2 −2 tools/dochack/fuzzysearch.nim
  201. +1 −1 tools/heapdumprepl.nim
  202. +1 −1 tools/vccexe/vccenv.nim
  203. +6 −6 tools/vccexe/vccexe.nim
  204. +1 −1 tools/vccexe/vcvarsall.nim
148 changes: 148 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
strategy:
matrix:
Linux_amd64:
vmImage: 'ubuntu-16.04'
CPU: amd64
Linux_i386:
vmImage: 'ubuntu-16.04'
CPU: i386
OSX_amd64:
vmImage: 'macOS-10.14'
CPU: amd64
OSX_amd64_cpp:
vmImage: 'macOS-10.14'
CPU: amd64
NIM_COMPILE_TO_CPP: true
Windows_amd64:
vmImage: 'windows-2019'
CPU: amd64
Windows_amd64_pkg:
vmImage: 'windows-2019'
CPU: amd64
NIM_TEST_PACKAGES: true

pool:
vmImage: $(vmImage)

workspace:
clean: all

steps:
- bash: git config --global core.autocrlf false
displayName: 'Disable auto conversion to CRLF by git (Windows-only)'
condition: eq(variables['Agent.OS'], 'Windows_NT')

- checkout: self

- bash: git clone --depth 1 https://github.com/nim-lang/csources.git
displayName: 'Checkout csources'

- task: NodeTool@0
inputs:
versionSpec: '8.x'
displayName: 'Install node.js 8.x'

- bash: |
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
displayName: 'Install dependencies (amd64 Linux)'
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'amd64'))
- bash: |
sudo dpkg --add-architecture i386
# Downgrade llvm, libgcc and libstdc++:
# - llvm has to be downgraded to have 32bit version installed for sfml.
# - libgcc and libstdc++ have to be downgraded as an optimization to
# prevent the use of the toolchain ppa, which has a terrible download
# speed.
cat << EOF | sudo tee /etc/apt/preferences.d/pin-to-rel
Package: libllvm6.0 libgcc1 libstdc++6
Pin: origin "azure.archive.ubuntu.com"
Pin-Priority: 1001
Package: *
Pin: release o=LP-PPA-ubuntu-toolchain-r-test
Pin-Priority: 100
EOF
sudo apt-fast update -qq
DEBIAN_FRONTEND='noninteractive' \
sudo apt-fast install --no-install-recommends --allow-downgrades -yq \
g++-multilib gcc-multilib libcurl4-openssl-dev:i386 libgc-dev:i386 \
libsdl1.2-dev:i386 libsfml-dev:i386 libglib2.0-dev:i386
cat << EOF > bin/gcc
#!/bin/bash
exec $(which gcc) -m32 "\$@"
EOF
cat << EOF > bin/g++
#!/bin/bash
exec $(which g++) -m32 "\$@"
EOF
chmod 755 bin/gcc
chmod 755 bin/g++
displayName: 'Install dependencies (i386 Linux)'
condition: and(eq(variables['Agent.OS'], 'Linux'), eq(variables['CPU'], 'i386'))
- bash: brew install boehmgc make sfml
displayName: 'Install dependencies (OSX)'
condition: eq(variables['Agent.OS'], 'Darwin')

- bash: |
mkdir dist
curl -L https://nim-lang.org/download/mingw64-6.3.0.7z -o dist/mingw64.7z
curl -L https://nim-lang.org/download/dlls.zip -o dist/dlls.zip
7z x dist/mingw64.7z -odist
7z x dist/dlls.zip -obin
echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/dist/mingw64/bin'
displayName: 'Install dependencies (Windows)'
condition: eq(variables['Agent.OS'], 'Windows_NT')
- bash: echo '##vso[task.prependpath]$(System.DefaultWorkingDirectory)/bin'
displayName: 'Add build binaries to PATH'

- bash: |
echo 'PATH:' "$PATH"
echo '##[section]gcc version'
gcc -v
echo '##[section]nodejs version'
node -v
echo '##[section]make version'
make -v
displayName: 'System information'
- bash: |
ncpu=
case '$(Agent.OS)' in
'Linux')
ncpu=$(nproc)
;;
'Darwin')
ncpu=$(sysctl -n hw.ncpu)
;;
'Windows_NT')
ncpu=$NUMBER_OF_PROCESSORS
;;
esac
[[ -z "$ncpu" || $ncpu -le 0 ]] && ncpu=1
make -C csources -j $ncpu CC=gcc ucpu=$(CPU)
displayName: 'Build csources'
- bash: nim c koch
displayName: 'Build koch'

# set result to omit the "bash exited with error code '1'" message
- bash: |
./koch runCI || echo '##vso[task.complete result=Failed]'
displayName: 'Run CI'
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
16 changes: 16 additions & 0 deletions build_all.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@echo off
rem build development version of the compiler; can be rerun safely
if not exist csources (
git clone --depth 1 https://github.com/nim-lang/csources.git
)
if not exist bin\nim.exe (
cd csources
if PROCESSOR_ARCHITECTURE == AMD64 (
SET ARCH=64
)
CALL build.bat
cd ..
)
bin\nim.exe c --skipUserCfg --skipParentCfg koch
koch.exe boot -d:release
koch.exe tools
2 changes: 1 addition & 1 deletion compiler/asciitables.nim
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ iterator parseTableCells*(s: string, delim = '\t'): Cell =
proc alignTable*(s: string, delim = '\t', fill = ' ', sep = " "): string =
## formats a `delim`-delimited `s` representing a table; each cell is aligned
## to a width that's computed for each column; consecutive columns are
## delimted by `sep`, and alignment space is filled using `fill`.
## delimited by `sep`, and alignment space is filled using `fill`.
## More customized formatting can be done by calling `parseTableCells` directly.
for cell in parseTableCells(s, delim):
result.add cell.text
Expand Down
10 changes: 5 additions & 5 deletions compiler/ast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ type
nkStmtListExpr, # a statement list followed by an expr; this is used
# to allow powerful multi-line templates
nkBlockExpr, # a statement block ending in an expr; this is used
# to allowe powerful multi-line templates that open a
# to allow powerful multi-line templates that open a
# temporary scope
nkStmtListType, # a statement list ending in a type; for macros
nkBlockType, # a statement block ending in a type; for macros
Expand Down Expand Up @@ -272,7 +272,7 @@ type
sfNamedParamCall, # symbol needs named parameter call syntax in target
# language; for interfacing with Objective C
sfDiscardable, # returned value may be discarded implicitly
sfOverriden, # proc is overriden
sfOverriden, # proc is overridden
sfCallsite # A flag for template symbols to tell the
# compiler it should use line information from
# the calling side of the macro, not from the
Expand Down Expand Up @@ -535,8 +535,8 @@ type
tfTriggersCompileTime # uses the NimNode type which make the proc
# implicitly '.compiletime'
tfRefsAnonObj # used for 'ref object' and 'ptr object'
tfCovariant # covariant generic param mimicing a ptr type
tfWeakCovariant # covariant generic param mimicing a seq/array type
tfCovariant # covariant generic param mimicking a ptr type
tfWeakCovariant # covariant generic param mimicking a seq/array type
tfContravariant # contravariant generic param
tfCheckedForDestructor # type was checked for having a destructor.
# If it has one, t.destructor is not nil.
Expand Down Expand Up @@ -1250,7 +1250,7 @@ proc skipTypes*(t: PType, kinds: TTypeKinds): PType =

proc newIntTypeNode*(intVal: BiggestInt, typ: PType): PNode =

# this is dirty. abstractVarRange isn't defined yet and therefor it
# this is dirty. abstractVarRange isn't defined yet and therefore it
# is duplicated here.
const abstractVarRange = {tyGenericInst, tyRange, tyVar, tyDistinct, tyOrdinal,
tyTypeDesc, tyAlias, tyInferred, tySink, tyOwned}
Expand Down
2 changes: 1 addition & 1 deletion compiler/ccgexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1027,7 +1027,7 @@ proc genAndOr(p: BProc, e: PNode, d: var TLoc, m: TMagic) =
dec p.splitDecls

proc genEcho(p: BProc, n: PNode) =
# this unusal way of implementing it ensures that e.g. ``echo("hallo", 45)``
# this unusual way of implementing it ensures that e.g. ``echo("hallo", 45)``
# is threadsafe.
internalAssert p.config, n.kind == nkBracket
if p.config.target.targetOS == osGenode:
Expand Down
2 changes: 1 addition & 1 deletion compiler/ccgstmts.nim
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ proc genStringCase(p: BProc, t: PNode, d: var TLoc) =
var branches: seq[Rope]
newSeq(branches, bitMask + 1)
var a: TLoc
initLocExpr(p, t.sons[0], a) # fist pass: gnerate ifs+goto:
initLocExpr(p, t.sons[0], a) # fist pass: generate ifs+goto:
var labId = p.labels
for i in 1 ..< len(t):
inc(p.labels)
Expand Down
3 changes: 2 additions & 1 deletion compiler/ccgtypes.nim
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ proc mangleParamName(m: BModule; s: PSym): Rope =
var res = s.name.s.mangle
# Take into account if HCR is on because of the following scenario:
# if a module gets imported and it has some more importc symbols in it,
# some param names might recieve the "_0" suffix to distinguish from what
# some param names might receive the "_0" suffix to distinguish from what
# is newly available. That might lead to changes in the C code in nimcache
# that contain only a parameter name change, but that is enough to mandate
# recompilation of that source file and thus a new shared object will be
Expand Down Expand Up @@ -287,6 +287,7 @@ proc fillResult(conf: ConfigRef; param: PNode) =

proc typeNameOrLiteral(m: BModule; t: PType, literal: string): Rope =
if t.sym != nil and sfImportc in t.sym.flags and t.sym.magic == mNone:
useHeader(m, t.sym)
result = t.sym.loc.r
else:
result = rope(literal)
Expand Down
13 changes: 7 additions & 6 deletions compiler/cgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -997,21 +997,22 @@ proc genProcAux(m: BModule, prc: PSym) =
closureSetup(p, prc)
genStmts(p, procBody) # modifies p.locals, p.init, etc.
var generatedProc: Rope
generatedProc.genCLineDir prc.info, m.config
if sfNoReturn in prc.flags:
if hasDeclspec in extccomp.CC[p.config.cCompiler].props:
header = "__declspec(noreturn) " & header
if sfPure in prc.flags:
if hasDeclspec in extccomp.CC[p.config.cCompiler].props:
header = "__declspec(naked) " & header
generatedProc = ropecg(p.module, "$N$1 {$n$2$3$4}$N$N",
generatedProc.add ropecg(p.module, "$1 {$n$2$3$4}$N$N",
[header, p.s(cpsLocals), p.s(cpsInit), p.s(cpsStmts)])
else:
if m.hcrOn and isReloadable(m, prc):
# Add forward declaration for "_actual"-suffixed functions defined in the same module (or inline).
# This fixes the use of methods and also the case when 2 functions within the same module
# call each other using directly the "_actual" versions (an optimization) - see issue #11608
addf(m.s[cfsProcHeaders], "$1;\n", [header])
generatedProc = ropecg(p.module, "$N$1 {$N", [header])
generatedProc.add ropecg(p.module, "$1 {", [header])
add(generatedProc, initGCFrame(p))
if optStackTrace in prc.options:
add(generatedProc, p.s(cpsLocals))
Expand Down Expand Up @@ -1255,7 +1256,7 @@ proc hcrGetProcLoadCode(m: BModule, sym, prefix, handle, getProcFunc: string): R

proc genMainProc(m: BModule) =
## this function is called in cgenWriteModules after all modules are closed,
## it means raising dependency on the symbols is too late as it will not propogate
## it means raising dependency on the symbols is too late as it will not propagate
## into other modules, only simple rope manipulations are allowed

var preMainCode: Rope
Expand Down Expand Up @@ -1514,7 +1515,7 @@ proc registerModuleToMain(g: BModuleList; m: BModule) =

proc genDatInitCode(m: BModule) =
## this function is called in cgenWriteModules after all modules are closed,
## it means raising dependency on the symbols is too late as it will not propogate
## it means raising dependency on the symbols is too late as it will not propagate
## into other modules, only simple rope manipulations are allowed

var moduleDatInitRequired = m.hcrOn
Expand Down Expand Up @@ -1558,7 +1559,7 @@ proc hcrGetProcLoadCode(m: BModule, sym, prefix, handle, getProcFunc: string): R

proc genInitCode(m: BModule) =
## this function is called in cgenWriteModules after all modules are closed,
## it means raising dependency on the symbols is too late as it will not propogate
## it means raising dependency on the symbols is too late as it will not propagate
## into other modules, only simple rope manipulations are allowed
var moduleInitRequired = m.hcrOn
let initname = getInitName(m)
Expand Down Expand Up @@ -1746,7 +1747,7 @@ proc rawNewModule(g: BModuleList; module: PSym, filename: AbsoluteFile): BModule
result.typeNodesName = getTempName(result)
result.nimTypesName = getTempName(result)
# no line tracing for the init sections of the system module so that we
# don't generate a TFrame which can confuse the stack botton initialization:
# don't generate a TFrame which can confuse the stack bottom initialization:
if sfSystemModule in module.flags:
incl result.flags, preventStackTrace
excl(result.preInitProc.options, optStackTrace)
Expand Down
4 changes: 2 additions & 2 deletions compiler/cgendata.nim
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ type
id*: int # the ID of the label; positive means that it
label*: Rope # generated text for the label
# nil if label is not used
sections*: TCProcSections # the code beloging
sections*: TCProcSections # the code belonging
isLoop*: bool # whether block is a loop
nestedTryStmts*: int16 # how many try statements is it nested into
nestedExceptStmts*: int16 # how many except statements is it nested into
Expand Down Expand Up @@ -150,7 +150,7 @@ type
initProc*: BProc # code for init procedure
preInitProc*: BProc # code executed before the init proc
hcrCreateTypeInfosProc*: Rope # type info globals are in here when HCR=on
inHcrInitGuard*: bool # We are currently withing a HCR reloading guard.
inHcrInitGuard*: bool # We are currently within a HCR reloading guard.
typeStack*: TTypeSeq # used for type generation
dataCache*: TNodeTable
typeNodes*, nimTypes*: int # used for type info generation
Expand Down
9 changes: 5 additions & 4 deletions compiler/closureiters.nim
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,8 @@ proc lowerStmtListExprs(ctx: var Ctx, n: PNode, needsSplit: var bool): PNode =
n[0] = ex
result.add(n)

of nkCast, nkHiddenStdConv, nkHiddenSubConv, nkConv, nkObjDownConv:
of nkCast, nkHiddenStdConv, nkHiddenSubConv, nkConv, nkObjDownConv,
nkDerefExpr, nkHiddenDeref:
var ns = false
for i in 0 ..< n.len:
n[i] = ctx.lowerStmtListExprs(n[i], ns)
Expand Down Expand Up @@ -757,7 +758,7 @@ proc lowerStmtListExprs(ctx: var Ctx, n: PNode, needsSplit: var bool): PNode =
n[0] = newSymNode(ctx.g.getSysSym(n[0].info, "true"))
n[1] = newBody

of nkDotExpr:
of nkDotExpr, nkCheckedFieldExpr:
var ns = false
n[0] = ctx.lowerStmtListExprs(n[0], ns)
if ns:
Expand Down Expand Up @@ -1288,7 +1289,7 @@ proc transformClosureIterator*(g: ModuleGraph; fn: PSym, n: PNode): PNode =
if getEnvParam(fn).isNil:
# Lambda lifting was not done yet. Use temporary :state sym, which will
# be handled specially by lambda lifting. Local temp vars (if needed)
# should folllow the same logic.
# should follow the same logic.
ctx.stateVarSym = newSym(skVar, getIdent(ctx.g.cache, ":state"), fn, fn.info)
ctx.stateVarSym.typ = g.createClosureIterStateType(fn)
ctx.stateLoopLabel = newSym(skLabel, getIdent(ctx.g.cache, ":stateLoop"), fn, fn.info)
Expand All @@ -1309,7 +1310,7 @@ proc transformClosureIterator*(g: ModuleGraph; fn: PSym, n: PNode): PNode =
# Optimize empty states away
ctx.deleteEmptyStates()

# Make new body by concating the list of states
# Make new body by concatenating the list of states
result = newNodeI(nkStmtList, n.info)
for s in ctx.states:
assert(s.len == 2)
Expand Down
2 changes: 1 addition & 1 deletion compiler/cmdlinehelper.nim
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ proc loadConfigsAndRunMainCommand*(self: NimProg, cache: IdentCache; conf: Confi
discard

# now process command line arguments again, because some options in the
# command line can overwite the config file's settings
# command line can overwrite the config file's settings
extccomp.initVars(conf)
self.processCmdLine(passCmd2, "", conf)
if conf.command == "":
Expand Down
2 changes: 1 addition & 1 deletion compiler/dfa.nim
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ proc genTry(c: var Con; n: PNode) =
let f = c.tryStmtFixups[i]
c.patch(f)
# we also need to produce join instructions
# for the 'fork' that might preceed the goto instruction
# for the 'fork' that might precede the goto instruction
if f.int-1 >= 0 and c.code[f.int-1].kind == fork:
c.joinI(TPosition(f.int-1), n)

Expand Down
2 changes: 1 addition & 1 deletion compiler/evaltempl.nim
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ proc evalTemplateArgs(n: PNode, s: PSym; conf: ConfigRef; fromHlo: bool): PNode
else:
addSon(result, default.copyTree)

# add any generic paramaters
# add any generic parameters
for i in 1 .. genericParams:
result.addSon n.sons[givenRegularParams + i]

Expand Down
Loading