fix wrong name (rnimsyn => renderer; pnimsyn => parser; scanner => lexer) (#18895)

* fix wrong module name

* rephrase more word
This commit is contained in:
flywind 2021-09-25 19:22:00 +08:00 • committed by GitHub
commit 8bdb985395
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -22,7 +22,7 @@ type
info: TLineInfo info: TLineInfo
indent, emitPar: int indent, emitPar: int
x: string # the current input line x: string # the current input line
outp: PLLStream # the output will be parsed by pnimsyn outp: PLLStream # the output will be parsed by parser
subsChar, nimDirective: char subsChar, nimDirective: char
emit, conc, toStr: string emit, conc, toStr: string
curly, bracket, par: int curly, bracket, par: int

View file

@ -7,12 +7,12 @@
# distribution, for details about the copyright. # distribution, for details about the copyright.
# #
# This scanner is handwritten for efficiency. I used an elegant buffering # This lexer is handwritten for efficiency. I used an elegant buffering
# scheme which I have not seen anywhere else: # scheme which I have not seen anywhere else:
# We guarantee that a whole line is in the buffer. Thus only when scanning # We guarantee that a whole line is in the buffer. Thus only when scanning
# the \n or \r character we have to check whether we need to read in the next # the \n or \r character we have to check whether we need to read in the next
# chunk. (\n or \r already need special handling for incrementing the line # chunk. (\n or \r already need special handling for incrementing the line
# counter; choosing both \n and \r allows the scanner to properly read Unix, # counter; choosing both \n and \r allows the lexer to properly read Unix,
# DOS or Macintosh text files, even when it is not the native format. # DOS or Macintosh text files, even when it is not the native format.
import import

View file

@ -14,7 +14,7 @@ import
options, idents, wordrecg, strtabs, lineinfos, pathutils, scriptconfig options, idents, wordrecg, strtabs, lineinfos, pathutils, scriptconfig
# ---------------- configuration file parser ----------------------------- # ---------------- configuration file parser -----------------------------
# we use Nim's scanner here to save space and work # we use Nim's lexer here to save space and work
proc ppGetTok(L: var Lexer, tok: var Token) = proc ppGetTok(L: var Lexer, tok: var Token) =
# simple filter # simple filter

View file

@ -410,7 +410,7 @@ proc atom(g: TSrcGen; n: PNode): string =
if (n.typ != nil) and (n.typ.sym != nil): result = n.typ.sym.name.s if (n.typ != nil) and (n.typ.sym != nil): result = n.typ.sym.name.s
else: result = "[type node]" else: result = "[type node]"
else: else:
internalError(g.config, "rnimsyn.atom " & $n.kind) internalError(g.config, "renderer.atom " & $n.kind)
result = "" result = ""
proc lcomma(g: TSrcGen; n: PNode, start: int = 0, theEnd: int = - 1): int = proc lcomma(g: TSrcGen; n: PNode, start: int = 0, theEnd: int = - 1): int =
@ -1699,7 +1699,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext, fromStmtList = false) =
gsub(g, n[0], c) gsub(g, n[0], c)
else: else:
#nkNone, nkExplicitTypeListCall: #nkNone, nkExplicitTypeListCall:
internalError(g.config, n.info, "rnimsyn.gsub(" & $n.kind & ')') internalError(g.config, n.info, "renderer.gsub(" & $n.kind & ')')
proc renderTree*(n: PNode, renderFlags: TRenderFlags = {}): string = proc renderTree*(n: PNode, renderFlags: TRenderFlags = {}): string =
if n == nil: return "<nil tree>" if n == nil: return "<nil tree>"

View file

@ -216,7 +216,7 @@ comment:
.. code-block:: nim .. code-block:: nim
i = 0 # This is a single comment over multiple lines. i = 0 # This is a single comment over multiple lines.
# The scanner merges these two pieces. # The lexer merges these two pieces.
# The comment continues here. # The comment continues here.