summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMiran <narimiran@disroot.org>2020-11-10 21:53:25 +0100
committerGitHub <noreply@github.com>2020-11-10 21:53:25 +0100
commitbbe49a14ae827b6474d692042406716a3b3dd71f (patch)
tree87408943da9ab5e805a17532bdcdb6f033df5f68
parentbc3c0487d3059900864d6e8074cf83555a5c446d (diff)
downloadNim-bbe49a14ae827b6474d692042406716a3b3dd71f.tar.gz
Correct all eggs (#15906)
* "eg" is a misspelled "egg", "e.g." is "exempli gratia"
* Also, "ie" is "i.e.".
-rwxr-xr-xbuild_all.sh4
-rw-r--r--compiler/main.nim2
-rw-r--r--compiler/msgs.nim8
-rw-r--r--compiler/packagehandling.nim4
-rw-r--r--compiler/renderer.nim2
-rw-r--r--compiler/semcall.nim2
-rw-r--r--compiler/semexprs.nim2
-rw-r--r--compiler/semstmts.nim2
-rw-r--r--compiler/sigmatch.nim4
-rw-r--r--compiler/strutils2.nim2
-rw-r--r--compiler/types.nim2
-rw-r--r--compiler/vm.nim4
-rw-r--r--koch.nim8
-rw-r--r--lib/core/macros.nim4
-rw-r--r--lib/pure/times.nim2
-rw-r--r--lib/std/jsonutils.nim2
-rw-r--r--lib/system/jssys.nim2
-rw-r--r--lib/system/strmantle.nim2
-rw-r--r--nimdoc/testproject/testproject.nim2
-rw-r--r--testament/categories.nim4
-rw-r--r--tests/config.nims2
-rw-r--r--tests/deps/jester-#head/jester/request.nim2
-rw-r--r--tests/deps/x11-1.0/xvlib.nim2
-rw-r--r--tests/misc/trunner.nim2
-rw-r--r--tests/stdlib/tjsonutils.nim2
-rw-r--r--tools/ci_generate.nim2
26 files changed, 38 insertions, 38 deletions
diff --git a/build_all.sh b/build_all.sh
index d3bba2211..e66980e56 100755
--- a/build_all.sh
+++ b/build_all.sh
@@ -1,7 +1,7 @@
 #! /bin/sh
 
 # build development version of the compiler; can be rerun safely.
-# arguments can be passed, eg `--os freebsd`
+# arguments can be passed, e.g. `--os freebsd`
 
 set -u # error on undefined variables
 set -e # exit on first error
@@ -24,7 +24,7 @@ build_nim_csources(){
   # avoid changing dir in case of failure
   (
     if [ $# -ne 0 ]; then
-      # some args were passed (eg: `--cpu i386`), need to call build.sh
+      # some args were passed (e.g.: `--cpu i386`), need to call build.sh
       build_nim_csources_via_script "$@"
     else
       # no args, use multiple Make jobs (5X faster on 16 cores: 10s instead of 50s)
diff --git a/compiler/main.nim b/compiler/main.nim
index 242bc0719..f9b0dd413 100644
--- a/compiler/main.nim
+++ b/compiler/main.nim
@@ -260,7 +260,7 @@ proc mainCommand*(graph: ModuleGraph) =
       conf.setNoteDefaults(warnLockLevel, false) # issue #13218
       conf.setNoteDefaults(warnRedefinitionOfLabel, false) # issue #13218
         # because currently generates lots of false positives due to conflation
-        # of labels links in doc comments, eg for random.rand:
+        # of labels links in doc comments, e.g. for random.rand:
         #  ## * `rand proc<#rand,Rand,Natural>`_ that returns an integer
         #  ## * `rand proc<#rand,Rand,range[]>`_ that returns a float
       commandDoc2(graph, false)
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
index 7b691323f..be3dc5ec4 100644
--- a/compiler/msgs.nim
+++ b/compiler/msgs.nim
@@ -233,11 +233,11 @@ template toFullPathConsiderDirty*(conf: ConfigRef; info: TLineInfo): string =
   string toFullPathConsiderDirty(conf, info.fileIndex)
 
 type FilenameOption* = enum
-  foAbs # absolute path, eg: /pathto/bar/foo.nim
-  foRelProject # relative to project path, eg: ../foo.nim
+  foAbs # absolute path, e.g.: /pathto/bar/foo.nim
+  foRelProject # relative to project path, e.g.: ../foo.nim
   foMagicSauce # magic sauce, shortest of (foAbs, foRelProject)
-  foName # lastPathPart, eg: foo.nim
-  foShort # foName without extension, eg: foo
+  foName # lastPathPart, e.g.: foo.nim
+  foShort # foName without extension, e.g.: foo
   foStacktrace # if optExcessiveStackTrace: foAbs else: foName
 
 proc toFilenameOption*(conf: ConfigRef, fileIdx: FileIndex, opt: FilenameOption): string =
diff --git a/compiler/packagehandling.nim b/compiler/packagehandling.nim
index 9a3224de2..a781f1d51 100644
--- a/compiler/packagehandling.nim
+++ b/compiler/packagehandling.nim
@@ -16,7 +16,7 @@ iterator myParentDirs(p: string): string =
     yield current
 
 proc getNimbleFile*(conf: ConfigRef; path: string): string =
-  ## returns absolute path to nimble file, eg: /pathto/cligen.nimble
+  ## returns absolute path to nimble file, e.g.: /pathto/cligen.nimble
   var parents = 0
   block packageSearch:
     for d in myParentDirs(path):
@@ -35,7 +35,7 @@ proc getNimbleFile*(conf: ConfigRef; path: string): string =
     if parents <= 0: break
 
 proc getPackageName*(conf: ConfigRef; path: string): string =
-  ## returns nimble package name, eg: `cligen`
+  ## returns nimble package name, e.g.: `cligen`
   let path = getNimbleFile(conf, path)
   result = path.splitFile.name
 
diff --git a/compiler/renderer.nim b/compiler/renderer.nim
index a4152cf29..765bcded5 100644
--- a/compiler/renderer.nim
+++ b/compiler/renderer.nim
@@ -1226,7 +1226,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
     infixArgument(g, n, 1)
     put(g, tkSpaces, Space)
     gsub(g, n, 0)        # binary operator
-    # eg: `n1 == n2` decompses as following sum:
+    # e.g.: `n1 == n2` decompses as following sum:
     if n.len == 3 and not fits(g, oldLineLen + lsub(g, n[1]) + lsub(g, n[2]) + lsub(g, n[0]) + len("  ")):
       optNL(g, g.indent + longIndentWid)
     else:
diff --git a/compiler/semcall.nim b/compiler/semcall.nim
index 0446d28c2..70a7e099c 100644
--- a/compiler/semcall.nim
+++ b/compiler/semcall.nim
@@ -326,7 +326,7 @@ proc getMsgDiagnostic(c: PContext, flags: TExprFlags, n, f: PNode): string =
     var typeHint = ""
     if sym == nil:
       # Perhaps we're in a `compiles(foo.bar)` expression, or
-      # in a concept, eg:
+      # in a concept, e.g.:
       #   ExplainedConcept {.explain.} = concept x
       #     x.foo is int
       # We could use: `(c.config $ n[1].info)` to get more context.
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index b2f0207e7..cb119b3e8 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -432,7 +432,7 @@ proc isOpImpl(c: PContext, n: PNode, flags: TExprFlags): PNode =
       m.diagnostics = @[]
       m.diagnosticsEnabled = true
     res = typeRel(m, t2, t1) >= isSubtype # isNone
-    # `res = sameType(t1, t2)` would be wrong, eg for `int is (int|float)`
+    # `res = sameType(t1, t2)` would be wrong, e.g. for `int is (int|float)`
 
   result = newIntNode(nkIntLit, ord(res))
   result.typ = n.typ
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 4b79cd546..f83864775 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -435,7 +435,7 @@ proc semLowerLetVarCustomPragma(c: PContext, a: PNode, n: PNode): PNode =
   var b = a[0]
   if b.kind == nkPragmaExpr:
     if b[1].len != 1:
-      # we could in future support pragmas w args eg: `var foo {.bar:"goo".} = expr`
+      # we could in future support pragmas w args e.g.: `var foo {.bar:"goo".} = expr`
       return nil
     let nodePragma = b[1][0]
     # see: `singlePragma`
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim
index d5039fcad..2e332f105 100644
--- a/compiler/sigmatch.nim
+++ b/compiler/sigmatch.nim
@@ -1555,7 +1555,7 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
         for i in 1..<f.len:
           let x = PType(idTableGet(c.bindings, genericBody[i-1]))
           if x == nil:
-            discard "maybe fine (for eg. a==tyNil)"
+            discard "maybe fine (for e.g. a==tyNil)"
           elif x.kind in {tyGenericInvocation, tyGenericParam}:
             internalError(c.c.graph.config, "wrong instantiated type!")
           else:
@@ -2489,7 +2489,7 @@ proc matchesAux(c: PContext, n, nOrig: PNode, m: var TCandidate, marker: var Int
             container = nil
           else:
             # we end up here if the argument can be converted into the varargs
-            # formal (eg. seq[T] -> varargs[T]) but we have already instantiated
+            # formal (e.g. seq[T] -> varargs[T]) but we have already instantiated
             # a container
             #assert arg.kind == nkHiddenStdConv # for 'nim check'
             # this assertion can be off
diff --git a/compiler/strutils2.nim b/compiler/strutils2.nim
index 6cb50347f..f44b811c7 100644
--- a/compiler/strutils2.nim
+++ b/compiler/strutils2.nim
@@ -12,7 +12,7 @@ proc dataPointer*[T](a: T): pointer =
   ## same as C++ `data` that works with std::string, std::vector etc.
   ## Note: safe to use when a.len == 0 but whether the result is nil or not
   ## is implementation defined for performance reasons.
-  # this could be improved with ocmpiler support to avoid the `if`, eg in C++
+  # this could be improved with ocmpiler support to avoid the `if`, e.g. in C++
   # `&a[0]` is well defined even if a.size() == 0
   when T is string | seq:
     if a.len == 0: nil else: cast[pointer](a[0].unsafeAddr)
diff --git a/compiler/types.nim b/compiler/types.nim
index 42b7de416..1f2ee9d20 100644
--- a/compiler/types.nim
+++ b/compiler/types.nim
@@ -23,7 +23,7 @@ type
     preferTypeName,
     preferResolved, # fully resolved symbols
     preferMixed,
-      # most useful, shows: symbol + resolved symbols if it differs, eg:
+      # most useful, shows: symbol + resolved symbols if it differs, e.g.:
       # tuple[a: MyInt{int}, b: float]
 
 proc typeToString*(typ: PType; prefer: TPreferedDesc = preferName): string
diff --git a/compiler/vm.nim b/compiler/vm.nim
index 8aac11ff7..a6478f3f0 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -765,7 +765,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
         if regs[rb].node.kind == nkRefTy:
           regs[ra].node = regs[rb].node[0]
         elif not maybeHandlePtr(regs[rb].node, regs[ra], false):
-          ## eg: typ.kind = tyObject
+          ## e.g.: typ.kind = tyObject
           ensureKind(rkNode)
           regs[ra].node = regs[rb].node
       else:
@@ -996,7 +996,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
         if nb.kind != nc.kind: discard
         elif (nb == nc) or (nb.kind == nkNilLit): ret = true # intentional
         elif sameConstant(nb, nc): ret = true
-          # this also takes care of procvar's, represented as nkTupleConstr, eg (nil, nil)
+          # this also takes care of procvar's, represented as nkTupleConstr, e.g. (nil, nil)
         elif nb.kind == nkIntLit and nc.kind == nkIntLit and nb.intVal == nc.intVal: # TODO: nkPtrLit
           let tb = nb.getTyp
           let tc = nc.getTyp
diff --git a/koch.nim b/koch.nim
index e34fdb4f4..47bde9d18 100644
--- a/koch.nim
+++ b/koch.nim
@@ -63,7 +63,7 @@ Possible Commands:
   distrohelper [bindir]    helper for distro packagers
   tools                    builds Nim related tools
   toolsNoExternal          builds Nim related tools (except external tools,
-                           ie. nimble)
+                           e.g. nimble)
                            doesn't require network connectivity
   nimble                   builds the Nimble tool
   fusion                   clone fusion into the working tree
@@ -76,14 +76,14 @@ Boot options:
                            for bootstrapping
 
 Commands for core developers:
-  runCI                    runs continuous integration (CI), eg from travis
+  runCI                    runs continuous integration (CI), e.g. from travis
   docs [options]           generates the full documentation
   csource -d:danger        builds the C sources for installation
   pdf                      builds the PDF documentation
   zip                      builds the installation zip package
   xz                       builds the installation tar.xz package
   testinstall              test tar.xz package; Unix only!
-  installdeps [options]    installs external dependency (eg tinyc) to dist/
+  installdeps [options]    installs external dependency (e.g. tinyc) to dist/
   tests [options]          run the testsuite (run a subset of tests by
                            specifying a category, e.g. `tests cat async`)
   temp options             creates a temporary compiler for testing
@@ -93,7 +93,7 @@ Web options:
                            build the official docs, use UA-48159761-1
 """
 
-let kochExe* = when isMainModule: os.getAppFilename() # always correct when koch is main program, even if `koch` exe renamed eg: `nim c -o:koch_debug koch.nim`
+let kochExe* = when isMainModule: os.getAppFilename() # always correct when koch is main program, even if `koch` exe renamed e.g.: `nim c -o:koch_debug koch.nim`
                else: getAppDir() / "koch".exe # works for winrelease
 
 proc kochExec*(cmd: string) =
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index e4a56d6f9..d2985bc72 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -160,7 +160,7 @@ proc `==`*(a, b: NimSym): bool {.magic: "EqNimrodNode", noSideEffect, deprecated
 
 proc sameType*(a, b: NimNode): bool {.magic: "SameNodeType", noSideEffect.} =
   ## Compares two Nim nodes' types. Return true if the types are the same,
-  ## eg. true when comparing alias with original type.
+  ## e.g. true when comparing alias with original type.
   discard
 
 proc len*(n: NimNode): int {.magic: "NLen", noSideEffect.}
@@ -280,7 +280,7 @@ else: # bootstrapping substitute
 when (NimMajor, NimMinor, NimPatch) >= (1, 3, 5) or defined(nimSymImplTransform):
   proc getImplTransformed*(symbol: NimNode): NimNode {.magic: "GetImplTransf", noSideEffect.}
     ## For a typed proc returns the AST after transformation pass; this is useful
-    ## for debugging how the compiler transforms code (eg: `defer`, `for`) but
+    ## for debugging how the compiler transforms code (e.g.: `defer`, `for`) but
     ## note that code transformations are implementation dependent and subject to change.
     ## See an example in `tests/macros/tmacros_various.nim`.
 
diff --git a/lib/pure/times.nim b/lib/pure/times.nim
index fb2f5e430..35dda131b 100644
--- a/lib/pure/times.nim
+++ b/lib/pure/times.nim
@@ -1049,7 +1049,7 @@ since((1, 3)):
   export isInitialized
 
 proc isLeapDay*(dt: DateTime): bool {.since: (1, 1).} =
-  ## returns whether `t` is a leap day, ie, Feb 29 in a leap year. This matters
+  ## Returns whether `t` is a leap day, i.e. Feb 29 in a leap year. This matters
   ## as it affects time offset calculations.
   runnableExamples:
     let dt = initDateTime(29, mFeb, 2020, 00, 00, 00, utc())
diff --git a/lib/std/jsonutils.nim b/lib/std/jsonutils.nim
index dd174303a..50dcd9675 100644
--- a/lib/std/jsonutils.nim
+++ b/lib/std/jsonutils.nim
@@ -17,7 +17,7 @@ import std/[json,strutils,tables,sets,strtabs,options]
 
 #[
 Future directions:
-add a way to customize serialization, for eg:
+add a way to customize serialization, for e.g.:
 * field renaming
 * allow serializing `enum` and `char` as `string` instead of `int`
   (enum is more compact/efficient, and robust to enum renamings, but string
diff --git a/lib/system/jssys.nim b/lib/system/jssys.nim
index df05a9a62..c4c671ea3 100644
--- a/lib/system/jssys.nim
+++ b/lib/system/jssys.nim
@@ -485,7 +485,7 @@ proc negInt64(a: int64): int64 {.compilerproc.} =
   result = a*(-1)
 
 proc nimFloatToString(a: float): cstring {.compilerproc.} =
-  ## ensures the result doesn't print like an integer, ie return 2.0, not 2
+  ## ensures the result doesn't print like an integer, i.e. return 2.0, not 2
   asm """
     function nimOnlyDigitsOrMinus(n) {
       return n.toString().match(/^-?\d+$/);
diff --git a/lib/system/strmantle.nim b/lib/system/strmantle.nim
index 21b790603..fa6ff411b 100644
--- a/lib/system/strmantle.nim
+++ b/lib/system/strmantle.nim
@@ -113,7 +113,7 @@ when defined(nimHasInvariant):
 proc nimParseBiggestFloat(s: string, number: var BiggestFloat,
                           start = 0): int {.compilerproc.} =
   # This routine attempt to parse float that can parsed quickly.
-  # ie whose integer part can fit inside a 53bits integer.
+  # i.e. whose integer part can fit inside a 53bits integer.
   # their real exponent must also be <= 22. If the float doesn't follow
   # these restrictions, transform the float into this form:
   #  INTEGER * 10 ^ exponent and leave the work to standard `strtod()`.
diff --git a/nimdoc/testproject/testproject.nim b/nimdoc/testproject/testproject.nim
index ffddc356f..3cb7fddc5 100644
--- a/nimdoc/testproject/testproject.nim
+++ b/nimdoc/testproject/testproject.nim
@@ -49,7 +49,7 @@ proc isValid*[T](x: T): bool = x.len > 0
 
 when true:
   # these cases appear redundant but they're actually (almost) all different at
-  # AST level and needed to ensure docgen keeps working, eg because of issues
+  # AST level and needed to ensure docgen keeps working, e.g. because of issues
   # like D20200526T163511
   type
     Foo* = enum
diff --git a/testament/categories.nim b/testament/categories.nim
index fa9391055..0d19842ec 100644
--- a/testament/categories.nim
+++ b/testament/categories.nim
@@ -413,7 +413,7 @@ proc testStdlib(r: var TResults, pattern, options: string, cat: Category) =
   proc isValid(file: string): bool =
     for dir in parentDirs(file, inclusive = false):
       if dir.lastPathPart in ["includes", "nimcache"]:
-        # eg: lib/pure/includes/osenv.nim gives: Error: This is an include file for os.nim!
+        # e.g.: lib/pure/includes/osenv.nim gives: Error: This is an include file for os.nim!
         return false
     let name = extractFilename(file)
     if name.splitFile.ext != ".nim": return false
@@ -433,7 +433,7 @@ proc testStdlib(r: var TResults, pattern, options: string, cat: Category) =
     #[
     todo:
     this logic is fragile:
-    false positives (if appears in a comment), or false negatives, eg
+    false positives (if appears in a comment), or false negatives, e.g.
     `when defined(osx) and isMainModule`.
     Instead of fixing this, see https://github.com/nim-lang/Nim/issues/10045
     for a much better way.
diff --git a/tests/config.nims b/tests/config.nims
index e91c3aa4f..640df9cad 100644
--- a/tests/config.nims
+++ b/tests/config.nims
@@ -1,7 +1,7 @@
 switch("path", "$lib/../testament/lib")
   # so we can `import stdtest/foo` inside tests
   # Using $lib/../ instead of $nim/ so you can use a different nim to run tests
-  # during local testing, eg nim --lib:lib.
+  # during local testing, e.g. nim --lib:lib.
 
 ## prevent common user config settings to interfere with testament expectations
 ## Indifidual tests can override this if needed to test for these options.
diff --git a/tests/deps/jester-#head/jester/request.nim b/tests/deps/jester-#head/jester/request.nim
index 7c6a1a961..20e5c840f 100644
--- a/tests/deps/jester-#head/jester/request.nim
+++ b/tests/deps/jester-#head/jester/request.nim
@@ -56,7 +56,7 @@ proc path*(req: Request): string =
     return u.path
 
 proc reqMethod*(req: Request): HttpMethod =
-  ## Request method, eg. HttpGet, HttpPost
+  ## Request method, e.g. HttpGet, HttpPost
   when useHttpBeast:
     req.req.httpMethod.get()
   else:
diff --git a/tests/deps/x11-1.0/xvlib.nim b/tests/deps/x11-1.0/xvlib.nim
index e642cb350..354a4b93b 100644
--- a/tests/deps/x11-1.0/xvlib.nim
+++ b/tests/deps/x11-1.0/xvlib.nim
@@ -155,7 +155,7 @@ type
     vert_y_period*: cuint
     vert_u_period*: cuint
     vert_v_period*: cuint
-    component_order*: array[0..31, char] # eg. UYVY
+    component_order*: array[0..31, char] # e.g. UYVY
     scanline_order*: cint     # XvTopToBottom, XvBottomToTop
 
   PXvImage* = ptr TXvImage
diff --git a/tests/misc/trunner.nim b/tests/misc/trunner.nim
index d67547d62..018916e67 100644
--- a/tests/misc/trunner.nim
+++ b/tests/misc/trunner.nim
@@ -149,7 +149,7 @@ mmain.html
       doAssert exitCode == 0, output
     block:
       let (output, exitCode) = runCmd(file, "-d:checkAbi -d:caseBad")
-      # on platforms that support _StaticAssert natively, errors will show full context, eg:
+      # on platforms that support _StaticAssert natively, errors will show full context, e.g.:
       # error: static_assert failed due to requirement 'sizeof(unsigned char) == 8'
       # "backend & Nim disagree on size for: BadImportcType{int64} [declared in mabi_check.nim(1, 6)]"
       check2 "sizeof(unsigned char) == 8"
diff --git a/tests/stdlib/tjsonutils.nim b/tests/stdlib/tjsonutils.nim
index fefd412e7..28f05ecbe 100644
--- a/tests/stdlib/tjsonutils.nim
+++ b/tests/stdlib/tjsonutils.nim
@@ -57,7 +57,7 @@ template fn() =
       """[1.1,"fo",120,[10,11],[true,false],[{"mode":"modeCaseSensitive","table":{"y":"Y","z":"Z"}},{"mode":"modeCaseSensitive","table":{}}],[0,3],-4,{"foo":0.5,"bar":{"a1":"abc"},"bar2":null}]"""
 
   block:
-    # edge case when user defined `==` doesn't handle `nil` well, eg:
+    # edge case when user defined `==` doesn't handle `nil` well, e.g.:
     # https://github.com/nim-lang/nimble/blob/63695f490728e3935692c29f3d71944d83bb1e83/src/nimblepkg/version.nim#L105
     testRoundtrip(@[Foo(id: 10), nil]): """[{"id":10},null]"""
 
diff --git a/tools/ci_generate.nim b/tools/ci_generate.nim
index bfed8d88f..dba10d74a 100644
--- a/tools/ci_generate.nim
+++ b/tools/ci_generate.nim
@@ -53,7 +53,7 @@ triggers:
 proc main()=
   let num = 3
     # if you reduce this, make sure to remove files that shouldn't be generated,
-    # or better, do the cleanup logic here eg: `rm .builds/openbsd_*`
+    # or better, do the cleanup logic here e.g.: `rm .builds/openbsd_*`
   for i in 0..<num:
     let file = fmt".builds/openbsd_{i}.yml"
     let code = genCIopenbsd(i, num)