compiler: minor code cleanups

This commit is contained in:
Araq
2020-07-27 08:05:52 +02:00
parent c229df95a4
commit a0049d1fb0
4 changed files with 4 additions and 5 deletions

View File

@@ -23,7 +23,7 @@
## do a compile-time copy-on-write analysis.
import
ast, types, renderer, idents, intsets, options, msgs
ast, types, renderer, idents, intsets, options
type
Cursor = object

View File

@@ -187,10 +187,9 @@ proc impMod(c: PContext; it: PNode; importStmtResult: PNode) =
let it = transformImportAs(c, it)
let m = myImportModule(c, it, importStmtResult)
if m != nil:
var emptySet: IntSet
# ``addDecl`` needs to be done before ``importAllSymbols``!
addDecl(c, m, it.info) # add symbol to symbol table of module
importAllSymbolsExcept(c, m, emptySet)
importAllSymbols(c, m)
#importForwarded(c, m.ast, emptySet, m)
proc evalImport*(c: PContext, n: PNode): PNode =

View File

@@ -11,7 +11,7 @@
## https://github.com/nim-lang/RFCs/issues/244 for more details.
import
ast, types, renderer, idents, intsets, options, msgs
ast, types, renderer, idents, intsets
proc canAlias(arg, ret: PType; marker: var IntSet): bool

View File

@@ -558,7 +558,7 @@ proc markUsed(c: PContext; info: TLineInfo; s: PSym) =
warnAboutDeprecated(conf, info, s)
if {sfDeprecated, sfError} * s.flags != {}:
if sfDeprecated in s.flags:
if not (c.lastTLineInfo.line == info.line and
if not (c.lastTLineInfo.line == info.line and
c.lastTLineInfo.col == info.col):
warnAboutDeprecated(conf, info, s)
c.lastTLineInfo = info