summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorFederico Ceratto <federico.ceratto@gmail.com>2019-09-27 06:02:54 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-09-27 07:02:54 +0200
commit39290cf88c5047e86dc4894e3190c63d5985f56f (patch)
treef37c9e0a5491fb9b11266ce08bddc297b57f37fc /compiler
parent9dd297f613768bb170e05dcaf361015d9448c582 (diff)
downloadNim-39290cf88c5047e86dc4894e3190c63d5985f56f.tar.gz
Fix spellings (#12277) [backport]
Diffstat (limited to 'compiler')
-rw-r--r--compiler/asciitables.nim2
-rw-r--r--compiler/ast.nim10
-rw-r--r--compiler/ccgexprs.nim2
-rw-r--r--compiler/ccgstmts.nim2
-rw-r--r--compiler/ccgtypes.nim2
-rw-r--r--compiler/cgen.nim8
-rw-r--r--compiler/cgendata.nim4
-rw-r--r--compiler/closureiters.nim4
-rw-r--r--compiler/cmdlinehelper.nim2
-rw-r--r--compiler/dfa.nim2
-rw-r--r--compiler/evaltempl.nim2
-rw-r--r--compiler/extccomp.nim4
-rw-r--r--compiler/filter_tmpl.nim2
-rw-r--r--compiler/hlo.nim2
-rw-r--r--compiler/importer.nim2
-rw-r--r--compiler/injectdestructors.nim4
-rw-r--r--compiler/lexer.nim2
-rw-r--r--compiler/lookups.nim2
-rw-r--r--compiler/modulegraphs.nim4
-rw-r--r--compiler/nimeval.nim2
-rw-r--r--compiler/nimfix/nimfix.nim2
-rw-r--r--compiler/nversion.nim2
-rw-r--r--compiler/options.nim2
-rw-r--r--compiler/parser.nim2
-rw-r--r--compiler/procfind.nim4
-rw-r--r--compiler/semcall.nim2
-rw-r--r--compiler/semexprs.nim2
-rw-r--r--compiler/seminst.nim2
-rw-r--r--compiler/semmagic.nim2
-rw-r--r--compiler/semobjconstr.nim2
-rw-r--r--compiler/sempass2.nim2
-rw-r--r--compiler/semtypinst.nim6
-rw-r--r--compiler/sizealignoffsetimpl.nim2
-rw-r--r--compiler/transf.nim4
-rw-r--r--compiler/types.nim2
-rw-r--r--compiler/vm.nim8
-rw-r--r--compiler/vmgen.nim2
-rw-r--r--compiler/vmops.nim2
38 files changed, 57 insertions, 57 deletions
diff --git a/compiler/asciitables.nim b/compiler/asciitables.nim
index c25d54bde..39bb26a5c 100644
--- a/compiler/asciitables.nim
+++ b/compiler/asciitables.nim
@@ -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
diff --git a/compiler/ast.nim b/compiler/ast.nim
index fdd91ef5e..a2598dae4 100644
--- a/compiler/ast.nim
+++ b/compiler/ast.nim
@@ -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
@@ -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
@@ -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.
@@ -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}
diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim
index f29995202..7a84fb1a2 100644
--- a/compiler/ccgexprs.nim
+++ b/compiler/ccgexprs.nim
@@ -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:
diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim
index ec579d9e7..6ff7cf91c 100644
--- a/compiler/ccgstmts.nim
+++ b/compiler/ccgstmts.nim
@@ -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)
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 3b8d93a5a..3cb508968 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -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
diff --git a/compiler/cgen.nim b/compiler/cgen.nim
index 625e48328..d1ac70d03 100644
--- a/compiler/cgen.nim
+++ b/compiler/cgen.nim
@@ -1255,7 +1255,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
@@ -1514,7 +1514,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
@@ -1558,7 +1558,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)
@@ -1746,7 +1746,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)
diff --git a/compiler/cgendata.nim b/compiler/cgendata.nim
index 0035931f0..6e451e953 100644
--- a/compiler/cgendata.nim
+++ b/compiler/cgendata.nim
@@ -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
@@ -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
diff --git a/compiler/closureiters.nim b/compiler/closureiters.nim
index ed4a2857f..84da6a84d 100644
--- a/compiler/closureiters.nim
+++ b/compiler/closureiters.nim
@@ -1288,7 +1288,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)
@@ -1309,7 +1309,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)
diff --git a/compiler/cmdlinehelper.nim b/compiler/cmdlinehelper.nim
index 26320d9cd..e44163d14 100644
--- a/compiler/cmdlinehelper.nim
+++ b/compiler/cmdlinehelper.nim
@@ -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 == "":
diff --git a/compiler/dfa.nim b/compiler/dfa.nim
index 2805e42fb..4016820e6 100644
--- a/compiler/dfa.nim
+++ b/compiler/dfa.nim
@@ -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)
 
diff --git a/compiler/evaltempl.nim b/compiler/evaltempl.nim
index 1fc7fd3db..90e309f80 100644
--- a/compiler/evaltempl.nim
+++ b/compiler/evaltempl.nim
@@ -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]
 
diff --git a/compiler/extccomp.nim b/compiler/extccomp.nim
index d65ab82fd..4c531e894 100644
--- a/compiler/extccomp.nim
+++ b/compiler/extccomp.nim
@@ -404,7 +404,7 @@ proc getConfigVar(conf: ConfigRef; c: TSystemCC, suffix: string): string =
                      CC[c].name & fullSuffix
     result = getConfigVar(conf, fullCCname)
     if result.len == 0:
-      # not overriden for this cross compilation setting?
+      # not overridden for this cross compilation setting?
       result = getConfigVar(conf, CC[c].name & fullSuffix)
   else:
     result = getConfigVar(conf, CC[c].name & fullSuffix)
@@ -757,7 +757,7 @@ proc getLinkCmd(conf: ConfigRef; output: AbsoluteFile,
     # way of being able to debug and rebuild the program at the same time. This
     # is accomplished using the /PDB:<filename> flag (there also exists the
     # /PDBALTPATH:<filename> flag). The only downside is that the .pdb files are
-    # atleast 300kb big (when linking statically to the runtime - or else 5mb+)
+    # at least 300kb big (when linking statically to the runtime - or else 5mb+)
     # and will quickly accumulate. There is a hacky solution: we could try to
     # delete all .pdb files with a pattern and swallow exceptions.
     #
diff --git a/compiler/filter_tmpl.nim b/compiler/filter_tmpl.nim
index 490c184cf..54218d73c 100644
--- a/compiler/filter_tmpl.nim
+++ b/compiler/filter_tmpl.nim
@@ -22,7 +22,7 @@ type
     info: TLineInfo
     indent, emitPar: int
     x: string                # the current input line
-    outp: PLLStream          # the ouput will be parsed by pnimsyn
+    outp: PLLStream          # the output will be parsed by pnimsyn
     subsChar, nimDirective: char
     emit, conc, toStr: string
     curly, bracket, par: int
diff --git a/compiler/hlo.nim b/compiler/hlo.nim
index 8ebc1ec35..3ff2dd410 100644
--- a/compiler/hlo.nim
+++ b/compiler/hlo.nim
@@ -14,7 +14,7 @@ proc hlo(c: PContext, n: PNode): PNode
 proc evalPattern(c: PContext, n, orig: PNode): PNode =
   internalAssert c.config, n.kind == nkCall and n.sons[0].kind == nkSym
   # we need to ensure that the resulting AST is semchecked. However, it's
-  # aweful to semcheck before macro invocation, so we don't and treat
+  # awful to semcheck before macro invocation, so we don't and treat
   # templates and macros as immediate in this context.
   var rule: string
   if optHints in c.config.options and hintPattern in c.config.notes:
diff --git a/compiler/importer.nim b/compiler/importer.nim
index 8d8034735..32a727f4b 100644
--- a/compiler/importer.nim
+++ b/compiler/importer.nim
@@ -27,7 +27,7 @@ proc importPureEnumField*(c: PContext; s: PSym) =
     if checkB == nil:
       strTableAdd(c.pureEnumFields, s)
     else:
-      # mark as ambigous:
+      # mark as ambiguous:
       incl(c.ambiguousSymbols, checkB.id)
       incl(c.ambiguousSymbols, s.id)
 
diff --git a/compiler/injectdestructors.nim b/compiler/injectdestructors.nim
index e66f4f25b..5354fd740 100644
--- a/compiler/injectdestructors.nim
+++ b/compiler/injectdestructors.nim
@@ -256,7 +256,7 @@ proc isLastRead(n: PNode; c: var Con): bool =
 
 proc initialized(code: ControlFlowGraph; pc: int,
                  init, uninit: var IntSet; comesFrom: int): int =
-  ## Computes the set of definitely initialized variables accross all code paths
+  ## Computes the set of definitely initialized variables across all code paths
   ## as an IntSet of IDs.
   var pc = pc
   while pc < code.len:
@@ -492,7 +492,7 @@ proc pArg(arg: PNode; c: var Con; isSink: bool): PNode =
         result.add pArg(arg[i], c, i < L and isSinkTypeForParam(parameters[i]))
     elif arg.containsConstSeq:
       # const sequences are not mutable and so we need to pass a copy to the
-      # sink parameter (bug #11524). Note that the string implemenation is
+      # sink parameter (bug #11524). Note that the string implementation is
       # different and can deal with 'const string sunk into var'.
       result = passCopyToSink(arg, c)
     elif arg.kind in {nkBracket, nkObjConstr, nkTupleConstr, nkCharLit..nkTripleStrLit}:
diff --git a/compiler/lexer.nim b/compiler/lexer.nim
index d1e75d314..781f023c3 100644
--- a/compiler/lexer.nim
+++ b/compiler/lexer.nim
@@ -134,7 +134,7 @@ type
   TErrorHandler* = proc (conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg: string)
   TLexer* = object of TBaseLexer
     fileIdx*: FileIndex
-    indentAhead*: int         # if > 0 an indendation has already been read
+    indentAhead*: int         # if > 0 an indentation has already been read
                               # this is needed because scanning comments
                               # needs so much look-ahead
     currLineIndent*: int
diff --git a/compiler/lookups.nim b/compiler/lookups.nim
index df1d23b9c..57d86c775 100644
--- a/compiler/lookups.nim
+++ b/compiler/lookups.nim
@@ -233,7 +233,7 @@ proc addInterfaceOverloadableSymAt*(c: PContext, scope: PScope, sym: PSym) =
   addInterfaceDeclAux(c, sym)
 
 when defined(nimfix):
-  # when we cannot find the identifier, retry with a changed identifer:
+  # when we cannot find the identifier, retry with a changed identifier:
   proc altSpelling(x: PIdent): PIdent =
     case x.s[0]
     of 'A'..'Z': result = getIdent(toLowerAscii(x.s[0]) & x.s.substr(1))
diff --git a/compiler/modulegraphs.nim b/compiler/modulegraphs.nim
index 320ce2e81..2dfd79144 100644
--- a/compiler/modulegraphs.nim
+++ b/compiler/modulegraphs.nim
@@ -64,7 +64,7 @@ type
     importModuleCallback*: proc (graph: ModuleGraph; m: PSym, fileIdx: FileIndex): PSym {.nimcall.}
     includeFileCallback*: proc (graph: ModuleGraph; m: PSym, fileIdx: FileIndex): PNode {.nimcall.}
     recordStmt*: proc (graph: ModuleGraph; m: PSym; n: PNode) {.nimcall.}
-    cacheSeqs*: Table[string, PNode] # state that is shared to suppor the 'macrocache' API
+    cacheSeqs*: Table[string, PNode] # state that is shared to support the 'macrocache' API
     cacheCounters*: Table[string, BiggestInt]
     cacheTables*: Table[string, BTree[string, PNode]]
     passes*: seq[TPass]
@@ -215,7 +215,7 @@ proc addDep*(g: ModuleGraph; m: PSym, dep: FileIndex) =
   addModuleDep(g.incr, g.config, m.info.fileIndex, dep, isIncludeFile = false)
   if g.suggestMode:
     g.deps.incl m.position.dependsOn(dep.int)
-    # we compute the transitive closure later when quering the graph lazily.
+    # we compute the transitive closure later when querying the graph lazily.
     # this improves efficiency quite a lot:
     #invalidTransitiveClosure = true
 
diff --git a/compiler/nimeval.nim b/compiler/nimeval.nim
index d03b99ba3..882e10fbb 100644
--- a/compiler/nimeval.nim
+++ b/compiler/nimeval.nim
@@ -46,7 +46,7 @@ proc selectUniqueSymbol*(i: Interpreter; name: string;
     s = nextIdentIter(it, i.mainModule.tab)
 
 proc selectRoutine*(i: Interpreter; name: string): PSym =
-  ## Selects a declared rountine (proc/func/etc) from the main module.
+  ## Selects a declared routine (proc/func/etc) from the main module.
   ## The routine needs to have the export marker ``*``. The only matching
   ## routine is returned and ``nil`` if it is overloaded.
   result = selectUniqueSymbol(i, name, {skTemplate, skMacro, skFunc,
diff --git a/compiler/nimfix/nimfix.nim b/compiler/nimfix/nimfix.nim
index 58b019cd3..96007477f 100644
--- a/compiler/nimfix/nimfix.nim
+++ b/compiler/nimfix/nimfix.nim
@@ -98,7 +98,7 @@ proc handleCmdLine(config: ConfigRef) =
       gProjectPath = getCurrentDir()
     loadConfigs(DefaultConfig, config) # load all config files
     # 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()
     processCmdLine(passCmd2, "", config)
     mainCommand()
diff --git a/compiler/nversion.nim b/compiler/nversion.nim
index 8981ae213..2da39b138 100644
--- a/compiler/nversion.nim
+++ b/compiler/nversion.nim
@@ -15,6 +15,6 @@ const
   VersionAsString* = system.NimVersion
   RodFileVersion* = "1223"       # modify this if the rod-format changes!
 
-  NimCompilerApiVersion* = 3 ## Check for the existance of this before accessing it
+  NimCompilerApiVersion* = 3 ## Check for the existence of this before accessing it
                              ## as older versions of the compiler API do not
                              ## declare this.
diff --git a/compiler/options.nim b/compiler/options.nim
index e96c20b7c..f401b1ae5 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -138,7 +138,7 @@ type
   LegacyFeature* = enum
     allowSemcheckedAstModification,
       ## Allows to modify a NimNode where the type has already been
-      ## flaged with nfSem. If you actually do this, it will cause
+      ## flagged with nfSem. If you actually do this, it will cause
       ## bugs.
 
   SymbolFilesOption* = enum
diff --git a/compiler/parser.nim b/compiler/parser.nim
index 101e66ba4..712997fa5 100644
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -710,7 +710,7 @@ proc identOrLiteral(p: var TParser, mode: TPrimaryMode): PNode =
     result = parseCast(p)
   else:
     parMessage(p, errExprExpected, p.tok)
-    getTok(p)  # we must consume a token here to prevend endless loops!
+    getTok(p)  # we must consume a token here to prevent endless loops!
     result = p.emptyNode
 
 proc namedParams(p: var TParser, callee: PNode,
diff --git a/compiler/procfind.nim b/compiler/procfind.nim
index 7247bb301..7e8cd3b8a 100644
--- a/compiler/procfind.nim
+++ b/compiler/procfind.nim
@@ -29,7 +29,7 @@ proc equalGenericParams(procA, procB: PNode): bool =
   result = true
 
 proc searchForProcOld*(c: PContext, scope: PScope, fn: PSym): PSym =
-  # Searchs for a forward declaration or a "twin" symbol of fn
+  # Searches for a forward declaration or a "twin" symbol of fn
   # in the symbol table. If the parameter lists are exactly
   # the same the sym in the symbol table is returned, else nil.
   var it: TIdentIter
@@ -108,7 +108,7 @@ when false:
       result = true
 
   proc searchForBorrowProc*(c: PContext, startScope: PScope, fn: PSym): PSym =
-    # Searchs for the fn in the symbol table. If the parameter lists are suitable
+    # Searches for the fn in the symbol table. If the parameter lists are suitable
     # for borrowing the sym in the symbol table is returned, else nil.
     var it: TIdentIter
     for scope in walkScopes(startScope):
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index 76f0e39af..f9f547c47 100644
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -640,7 +640,7 @@ proc explicitGenericInstantiation(c: PContext, n: PNode, s: PSym): PNode =
     result = explicitGenericInstError(c, n)
 
 proc searchForBorrowProc(c: PContext, startScope: PScope, fn: PSym): PSym =
-  # Searchs for the fn in the symbol table. If the parameter lists are suitable
+  # Searches for the fn in the symbol table. If the parameter lists are suitable
   # for borrowing the sym in the symbol table is returned, else nil.
   # New approach: generate fn(x, y, z) where x, y, z have the proper types
   # and use the overloading resolution mechanism:
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 2f0eccd8c..7a72f1602 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -2038,7 +2038,7 @@ proc tryExpr(c: PContext, n: PNode, flags: TExprFlags = {}): PNode =
   let oldErrorMax = c.config.errorMax
   let oldCompilesId = c.compilesContextId
   # if this is a nested 'when compiles', do not increase the ID so that
-  # generic instantations can still be cached for this level.
+  # generic instantiations can still be cached for this level.
   if c.compilesContextId == 0:
     inc c.compilesContextIdGenerator
     c.compilesContextId = c.compilesContextIdGenerator
diff --git a/compiler/seminst.nim b/compiler/seminst.nim
index 0a8a3c3af..a45e1665a 100644
--- a/compiler/seminst.nim
+++ b/compiler/seminst.nim
@@ -211,7 +211,7 @@ proc instGenericContainer(c: PContext, info: TLineInfo, header: PType,
       param.typ = makeTypeDesc(c, header[i+1])
 
     # this scope was not created by the user,
-    # unused params shoudn't be reported.
+    # unused params shouldn't be reported.
     param.flags.incl sfUsed
     addDecl(c, param)
 
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim
index 29f51d578..2d2506223 100644
--- a/compiler/semmagic.nim
+++ b/compiler/semmagic.nim
@@ -279,7 +279,7 @@ proc semDynamicBindSym(c: PContext, n: PNode): PNode =
     a.setResult opBindSym(c, scope, a.getNode(0), a.getInt(1).int, a.getNode(2))
 
   let
-    # altough we use VM callback here, it is not
+    # although we use VM callback here, it is not
     # executed like 'normal' VM callback
     idx = vm.registerCallback("bindSymImpl", bindSymWrapper)
     # dummy node to carry idx information to VM
diff --git a/compiler/semobjconstr.nim b/compiler/semobjconstr.nim
index 9f342e3b9..b71198fd8 100644
--- a/compiler/semobjconstr.nim
+++ b/compiler/semobjconstr.nim
@@ -339,7 +339,7 @@ proc semConstructFields(c: PContext, recNode: PNode,
         result = initPartial
         if discriminatorVal.kind == nkIntLit:
           # When the discriminator is a compile-time value, we also know
-          # which brach will be selected:
+          # which branch will be selected:
           let matchedBranch = recNode.pickCaseBranch discriminatorVal
           if matchedBranch != nil: checkMissingFields matchedBranch
         else:
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim
index c114dde95..397a710ce 100644
--- a/compiler/sempass2.nim
+++ b/compiler/sempass2.nim
@@ -575,7 +575,7 @@ proc trackOperand(tracked: PEffects, n: PNode, paramType: PType; caller: PNode)
   notNilCheck(tracked, n, paramType)
 
 proc breaksBlock(n: PNode): bool =
-  # sematic check doesn't allow statements after raise, break, return or
+  # semantic check doesn't allow statements after raise, break, return or
   # call to noreturn proc, so it is safe to check just the last statements
   var it = n
   while it.kind in {nkStmtList, nkStmtListExpr} and it.len > 0:
diff --git a/compiler/semtypinst.nim b/compiler/semtypinst.nim
index 518921d12..1b2f80229 100644
--- a/compiler/semtypinst.nim
+++ b/compiler/semtypinst.nim
@@ -76,13 +76,13 @@ type
     c*: PContext
     typeMap*: ptr LayeredIdTable # map PType to PType
     symMap*: TIdTable         # map PSym to PSym
-    localCache*: TIdTable     # local cache for remembering alraedy replaced
+    localCache*: TIdTable     # local cache for remembering already replaced
                               # types during instantiation of meta types
                               # (they are not stored in the global cache)
     info*: TLineInfo
     allowMetaTypes*: bool     # allow types such as seq[Number]
                               # i.e. the result contains unresolved generics
-    skipTypedesc*: bool       # wether we should skip typeDescs
+    skipTypedesc*: bool       # whether we should skip typeDescs
     isReturnType*: bool
     owner*: PSym              # where this instantiation comes from
     recursionLimit: int
@@ -249,7 +249,7 @@ proc replaceTypeVarsS(cl: var TReplTypeVars, s: PSym): PSym =
     return s
 
   # XXX: Bound symbols in default parameter expressions may reach here.
-  # We cannot process them, becase `sym.n` may point to a proc body with
+  # We cannot process them, because `sym.n` may point to a proc body with
   # cyclic references that will lead to an infinite recursion.
   # Perhaps we should not use a black-list here, but a whitelist instead
   # (e.g. skGenericParam and skType).
diff --git a/compiler/sizealignoffsetimpl.nim b/compiler/sizealignoffsetimpl.nim
index fdca01136..b1c136f2f 100644
--- a/compiler/sizealignoffsetimpl.nim
+++ b/compiler/sizealignoffsetimpl.nim
@@ -16,7 +16,7 @@ proc align(address, alignment: int): int =
   result = (address + (alignment - 1)) and not (alignment - 1)
 
 const
-  ## a size is concidered "unknown" when it is an imported type from C
+  ## a size is considered "unknown" when it is an imported type from C
   ## or C++.
   szUnknownSize* = -3
   szIllegalRecursion* = -2
diff --git a/compiler/transf.nim b/compiler/transf.nim
index f1c89939f..7521fe169 100644
--- a/compiler/transf.nim
+++ b/compiler/transf.nim
@@ -877,7 +877,7 @@ proc hoistParamsUsedInDefault(c: PTransf, call, letSection, defExpr: PNode): PNo
   # The recursion may confuse you. It performs two duties:
   #
   # 1) extracting all referenced params from default expressions
-  #    into a let section preceeding the call
+  #    into a let section preceding the call
   #
   # 2) replacing the "references" within the default expression
   #    with these extracted skLet symbols.
@@ -1140,7 +1140,7 @@ proc transformBody*(g: ModuleGraph, prc: PSym, cache = true;
 
     let cache = cache or prc.typ.callConv == ccInline
     if cache:
-      # genProc for inline procs will be called multiple times from diffrent modules,
+      # genProc for inline procs will be called multiple times from different modules,
       # it is important to transform exactly once to get sym ids and locations right
       prc.transformedBody = result
     else:
diff --git a/compiler/types.nim b/compiler/types.nim
index 1ed882cb8..fa5aff245 100644
--- a/compiler/types.nim
+++ b/compiler/types.nim
@@ -303,7 +303,7 @@ proc analyseObjectWithTypeFieldAux(t: PType,
 
 proc analyseObjectWithTypeField*(t: PType): TTypeFieldResult =
   # this does a complex analysis whether a call to ``objectInit`` needs to be
-  # made or intializing of the type field suffices or if there is no type field
+  # made or initializing of the type field suffices or if there is no type field
   # at all in this type.
   var marker = initIntSet()
   result = analyseObjectWithTypeFieldAux(t, marker)
diff --git a/compiler/vm.nim b/compiler/vm.nim
index 0496e37ca..6be4cbdba 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -156,7 +156,7 @@ proc createStrKeepNode(x: var TFullReg; keepNode=true) =
     x.node = newNode(nkStrLit)
     # It not only hackey, it is also wrong for tgentemplate. The primary
     # cause of bugs like these is that the VM does not properly distinguish
-    # between variable defintions (var foo = e) and variable updates (foo = e).
+    # between variable definitions (var foo = e) and variable updates (foo = e).
 
 include vmhooks
 
@@ -357,7 +357,7 @@ proc cleanUpOnReturn(c: PCtx; f: PStackFrame): int =
   result = -1
 
   # Traverse the stack starting from the end in order to execute the blocks in
-  # the inteded order
+  # the intended order
   for i in 1 .. f.safePoints.len:
     var pc = f.safePoints[^i]
     # Skip the `except` blocks
@@ -1189,7 +1189,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
       tos.pushSafePoint(pc + rbx)
       assert c.code[pc+rbx].opcode in {opcExcept, opcFinally}
     of opcExcept:
-      # This opcode is never executed, it only holds informations for the
+      # This opcode is never executed, it only holds information for the
       # exception handling routines.
       doAssert(false)
     of opcFinally:
@@ -1275,7 +1275,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
       regs[ra].node = getNullValue(typ, c.debug[pc], c.config)
       # opcLdNull really is the gist of the VM's problems: should it load
       # a fresh null to  regs[ra].node  or to regs[ra].node[]? This really
-      # depends on whether regs[ra] represents the variable itself or wether
+      # depends on whether regs[ra] represents the variable itself or whether
       # it holds the indirection! Due to the way registers are re-used we cannot
       # say for sure here! --> The codegen has to deal with it
       # via 'genAsgnPatch'.
diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim
index 0bd5cfdeb..ba9f62e3c 100644
--- a/compiler/vmgen.nim
+++ b/compiler/vmgen.nim
@@ -127,7 +127,7 @@ proc gABC(ctx: PCtx; n: PNode; opc: TOpcode; a, b, c: TRegister = 0) =
   ctx.debug.add(n.info)
 
 proc gABI(c: PCtx; n: PNode; opc: TOpcode; a, b: TRegister; imm: BiggestInt) =
-  # Takes the `b` register and the immediate `imm`, appies the operation `opc`,
+  # Takes the `b` register and the immediate `imm`, applies the operation `opc`,
   # and stores the output value into `a`.
   # `imm` is signed and must be within [-128, 127]
   if imm >= -128 and imm <= 127:
diff --git a/compiler/vmops.nim b/compiler/vmops.nim
index fe3c2516b..a989231dd 100644
--- a/compiler/vmops.nim
+++ b/compiler/vmops.nim
@@ -7,7 +7,7 @@
 #    distribution, for details about the copyright.
 #
 
-# Unforunately this cannot be a module yet:
+# Unfortunately this cannot be a module yet:
 #import vmdeps, vm
 from math import sqrt, ln, log10, log2, exp, round, arccos, arcsin,
   arctan, arctan2, cos, cosh, hypot, sinh, sin, tan, tanh, pow, trunc,