[refactoring] remove unused imports in the compiler and in some stdlib modules

This commit is contained in:
Araq 2019-07-18 00:36:03 +02:00
commit 07d465ca42
76 changed files with 531 additions and 558 deletions

View file

@ -10,8 +10,7 @@
# abstract syntax tree + symbol table
import
lineinfos, hashes, nversion, options, strutils, std / sha1, ropes, idents,
intsets, idgen
lineinfos, hashes, options, ropes, idents, idgen
type
TCallingConvention* = enum

View file

@ -11,8 +11,8 @@
## is needed for incremental compilation.
import
ast, astalgo, ropes, options, strutils, nimlexbase, msgs, cgendata, rodutils,
intsets, platform, llstream, tables, sighashes, modulegraphs, pathutils
ast, ropes, options, strutils, nimlexbase, cgendata, rodutils,
intsets, llstream, tables, modulegraphs, pathutils
# Careful! Section marks need to contain a tabulator so that they cannot
# be part of C string literals.

View file

@ -10,7 +10,7 @@
# This module declares some helpers for the C code generator.
import
ast, astalgo, ropes, hashes, strutils, types, msgs, wordrecg,
ast, hashes, strutils, msgs, wordrecg,
platform, trees, options
proc getPragmaStmt*(n: PNode, w: TSpecialWord): PNode =

View file

@ -11,9 +11,9 @@
import
ast, astalgo, hashes, trees, platform, magicsys, extccomp, options, intsets,
nversion, nimsets, msgs, std / sha1, bitsets, idents, types,
nversion, nimsets, msgs, bitsets, idents, types,
ccgutils, os, ropes, math, passes, wordrecg, treetab, cgmeth,
condsyms, rodutils, renderer, idgen, cgendata, ccgmerge, semfold, aliases,
condsyms, rodutils, renderer, cgendata, ccgmerge, aliases,
lowerings, tables, sets, ndi, lineinfos, pathutils, transf, enumtostr
when not defined(leanCompiler):

View file

@ -10,7 +10,7 @@
## This module contains the data structures for the C code generation phase.
import
ast, astalgo, ropes, passes, options, intsets, platform, sighashes,
ast, ropes, passes, options, intsets,
tables, ndi, lineinfos, pathutils, modulegraphs
type

View file

@ -10,7 +10,7 @@
## This module implements code generation for multi methods.
import
intsets, options, ast, astalgo, msgs, idents, renderer, types, magicsys,
intsets, options, ast, msgs, idents, renderer, types, magicsys,
sempass2, strutils, modulegraphs, lineinfos
proc genConv(n: PNode, d: PType, downcast: bool; conf: ConfigRef): PNode =

View file

@ -131,8 +131,8 @@
# break :stateLoop
import
intsets, strutils, options, ast, astalgo, trees, treetab, msgs, idents,
renderer, types, magicsys, lowerings, lambdalifting, modulegraphs, lineinfos
ast, msgs, idents,
renderer, magicsys, lowerings, lambdalifting, modulegraphs, lineinfos
type
Ctx = object

View file

@ -27,7 +27,7 @@ bootSwitch(usedNoGC, defined(nogc), "--gc:none")
import
os, msgs, options, nversion, condsyms, strutils, extccomp, platform,
wordrecg, parseutils, nimblecmd, idents, parseopt, sequtils, lineinfos,
wordrecg, parseutils, nimblecmd, parseopt, sequtils, lineinfos,
pathutils, strtabs
# but some have deps to imported modules. Yay.

View file

@ -10,7 +10,7 @@
# This module handles the conditional symbols.
import
strtabs, platform, strutils, idents
strtabs
from options import Feature
from lineinfos import HintsToStr, WarningsToStr

View file

@ -10,8 +10,7 @@
# This module implements a dependency file generator.
import
os, options, ast, astalgo, msgs, ropes, idents, passes, modulepaths,
pathutils
options, ast, ropes, idents, passes, modulepaths, pathutils
from modulegraphs import ModuleGraph, PPassContext

View file

@ -29,7 +29,7 @@
## "A Graph–Free Approach to Data–Flow Analysis" by Markus Mohnen.
## https://link.springer.com/content/pdf/10.1007/3-540-45937-5_6.pdf
import ast, astalgo, types, intsets, tables, msgs, options, lineinfos, renderer
import ast, types, intsets, lineinfos, renderer
from patterns import sameTrees

View file

@ -16,7 +16,7 @@ import
wordrecg, syntaxes, renderer, lexer, packages/docutils/rstast,
packages/docutils/rst, packages/docutils/rstgen,
packages/docutils/highlite, json, xmltree, cgi, trees, types,
typesrenderer, astalgo, modulepaths, lineinfos, sequtils, intsets,
typesrenderer, astalgo, modulepaths, lineinfos, intsets,
pathutils, trees
const

View file

@ -11,8 +11,7 @@
# semantic checking.
import
os, options, ast, astalgo, msgs, ropes, idents, passes, docgen, lineinfos,
pathutils
options, ast, msgs, idents, passes, docgen, lineinfos, pathutils
from modulegraphs import ModuleGraph, PPassContext

View file

@ -10,8 +10,7 @@
## Template evaluation engine. Now hygienic.
import
strutils, options, ast, astalgo, msgs, os, idents, wordrecg, renderer,
lineinfos
strutils, options, ast, astalgo, msgs, renderer, lineinfos
type
TemplCtx = object

View file

@ -10,8 +10,8 @@
# This module implements Nim's standard template filter.
import
llstream, os, wordrecg, idents, strutils, ast, astalgo, msgs, options,
renderer, filters, lineinfos, pathutils
llstream, strutils, ast, msgs, options,
filters, lineinfos, pathutils
type
TParseState = enum

View file

@ -10,7 +10,7 @@
# This module implements Nim's simple filters and helpers for filters.
import
llstream, os, wordrecg, idents, strutils, ast, astalgo, msgs, options,
llstream, idents, strutils, ast, msgs, options,
renderer, pathutils
proc invalidPragma(conf: ConfigRef; n: PNode) =

View file

@ -9,7 +9,7 @@
## Module that implements ``gorge`` for the compiler.
import msgs, std / sha1, os, osproc, streams, strutils, options,
import msgs, std / sha1, os, osproc, streams, options,
lineinfos, pathutils
proc readOutput(p: Process): (string, int) =

View file

@ -12,7 +12,7 @@
# id. This module is essential for the compiler's performance.
import
hashes, strutils, wordrecg
hashes, wordrecg
type
TIdObj* = object of RootObj

View file

@ -9,7 +9,7 @@
## This module contains a simple persistent id generator.
import idents, strutils, os, options, pathutils
import idents, strutils, options, pathutils
var gFrontEndId*: int

View file

@ -10,8 +10,8 @@
## This module implements the symbol importing mechanism.
import
intsets, strutils, os, ast, astalgo, msgs, options, idents, lookups,
semdata, passes, renderer, modulepaths, sigmatch, lineinfos
intsets, ast, astalgo, msgs, options, idents, lookups,
semdata, modulepaths, sigmatch, lineinfos
proc readExceptSet*(c: PContext, n: PNode): IntSet =
assert n.kind in {nkImportExceptStmt, nkExportExceptStmt}

View file

@ -12,10 +12,10 @@
const nimIncremental* = defined(nimIncremental)
import options, lineinfos, pathutils
import options, lineinfos
when nimIncremental:
import ast, msgs, intsets, btrees, db_sqlite, std / sha1
import ast, msgs, intsets, btrees, db_sqlite, std / sha1, pathutils
from strutils import parseInt
type

View file

@ -134,7 +134,7 @@ to do it.
]#
import
intsets, ast, astalgo, msgs, renderer, magicsys, types, idents, trees,
intsets, ast, msgs, renderer, magicsys, types, idents,
strutils, options, dfa, lowerings, tables, modulegraphs, msgs,
lineinfos, parampatterns, sighashes

View file

@ -29,11 +29,11 @@ implements the required case distinction.
import
ast, astalgo, strutils, hashes, trees, platform, magicsys, extccomp, options,
nversion, nimsets, msgs, std / sha1, bitsets, idents, types, os, tables,
times, ropes, math, passes, ccgutils, wordrecg, renderer,
ast, strutils, trees, magicsys, options,
nversion, msgs, idents, types, tables,
ropes, math, passes, ccgutils, wordrecg, renderer,
intsets, cgmeth, lowerings, sighashes, modulegraphs, lineinfos, rodutils,
pathutils, transf
transf
from modulegraphs import ModuleGraph, PPassContext

View file

@ -10,7 +10,7 @@
# This file implements lambda lifting for the transformator.
import
intsets, strutils, options, ast, astalgo, trees, treetab, msgs,
intsets, strutils, options, ast, astalgo, msgs,
idents, renderer, types, magicsys, lowerings, tables, modulegraphs, lineinfos,
transf, liftdestructors

View file

@ -13,7 +13,7 @@
# Todo:
# - use openArray instead of array to avoid over-specializations
import modulegraphs, lineinfos, idents, ast, astalgo, renderer, semdata,
import modulegraphs, lineinfos, idents, ast, renderer, semdata,
sighashes, lowerings, options, types, msgs, magicsys, tables
type

View file

@ -10,7 +10,7 @@
## This module implements the '.liftLocals' pragma.
import
intsets, strutils, options, ast, astalgo, msgs,
strutils, options, ast, msgs,
idents, renderer, types, lowerings, lineinfos
from pragmas import getPragmaVal

View file

@ -9,11 +9,9 @@
## This module implements the style checker.
import
strutils, os, intsets, strtabs
import strutils
import options, ast, astalgo, msgs, semdata, ropes, idents,
lineinfos, pathutils, wordrecg
import options, ast, msgs, idents, lineinfos, wordrecg
const
Letters* = {'a'..'z', 'A'..'Z', '0'..'9', '\x80'..'\xFF', '_'}

View file

@ -10,7 +10,7 @@
## Low-level streams for high performance.
import
strutils, pathutils
pathutils
# support '-d:useGnuReadline' for backwards compatibility:
when not defined(windows) and (defined(useGnuReadline) or defined(useLinenoise)):

View file

@ -11,7 +11,7 @@
import
intsets, ast, astalgo, idents, semdata, types, msgs, options,
renderer, wordrecg, idgen, nimfix/prettybase, lineinfos, strutils
renderer, nimfix/prettybase, lineinfos, strutils
proc ensureNoMissingOrUnusedSymbols(c: PContext; scope: PScope)

View file

@ -14,7 +14,6 @@ const
import ast, astalgo, types, idents, magicsys, msgs, options, modulegraphs,
lineinfos
from trees import getMagic
proc newDeref*(n: PNode): PNode {.inline.} =
result = newNodeIT(nkHiddenDeref, n.info, n.typ.sons[0])

View file

@ -9,7 +9,7 @@
## This module implements helpers for the macro cache.
import lineinfos, ast, modulegraphs, vmdef, magicsys
import lineinfos, ast, modulegraphs, vmdef
proc recordInc*(c: PCtx; info: TLineInfo; key: string; by: BiggestInt) =
var recorded = newNodeI(nkCommentStmt, info)

View file

@ -10,7 +10,7 @@
# Built-in types and compilerprocs are registered here.
import
ast, astalgo, hashes, msgs, platform, nversion, times, idents,
ast, astalgo, msgs, platform, idents,
modulegraphs, lineinfos
export createMagic

View file

@ -13,12 +13,12 @@ when not defined(nimcore):
{.error: "nimcore MUST be defined for Nim's core tooling".}
import
llstream, strutils, ast, astalgo, lexer, syntaxes, renderer, options, msgs,
os, condsyms, times,
wordrecg, sem, semdata, idents, passes, extccomp,
llstream, strutils, ast, lexer, syntaxes, options, msgs,
condsyms, times,
sem, idents, passes, extccomp,
cgen, json, nversion,
platform, nimconf, importer, passaux, depends, vm, vmdef, types, idgen,
parser, modules, ccgutils, sigmatch, ropes,
platform, nimconf, passaux, depends, vm, idgen,
parser, modules,
modulegraphs, tables, rod, lineinfos, pathutils
when not defined(leanCompiler):

View file

@ -8,7 +8,7 @@
#
import ast, renderer, strutils, msgs, options, idents, os, lineinfos,
pathutils, nimblecmd
pathutils
when false:
const

View file

@ -10,8 +10,8 @@
## Implements the module handling, including the caching of modules.
import
ast, astalgo, magicsys, std / sha1, msgs, cgendata, sigmatch, options,
idents, os, lexer, idgen, passes, syntaxes, llstream, modulegraphs, rod,
ast, astalgo, magicsys, msgs, options,
idents, lexer, idgen, passes, syntaxes, llstream, modulegraphs, rod,
lineinfos, pathutils, tables
proc resetSystemArtifacts*(g: ModuleGraph) =

View file

@ -8,7 +8,7 @@
#
import
options, strutils, os, tables, ropes, platform, terminal, macros,
options, strutils, os, tables, ropes, terminal, macros,
lineinfos, pathutils
proc toCChar*(c: char; result: var string) =

View file

@ -19,9 +19,9 @@ when defined(i386) and defined(windows) and defined(vcc):
{.link: "../icons/nim-i386-windows-vcc.res".}
import
commands, lexer, condsyms, options, msgs, nversion, nimconf, ropes,
extccomp, strutils, os, osproc, platform, main, parseopt,
scriptconfig, idents, modulegraphs, lineinfos, cmdlinehelper,
commands, options, msgs,
extccomp, strutils, os, main, parseopt,
idents, lineinfos, cmdlinehelper,
pathutils
include nodejs

View file

@ -10,7 +10,7 @@
# This module handles the reading of the config file.
import
llstream, nversion, commands, os, strutils, msgs, platform, condsyms, lexer,
llstream, commands, os, strutils, msgs, lexer,
options, idents, wordrecg, strtabs, lineinfos, pathutils
# ---------------- configuration file parser -----------------------------

View file

@ -8,9 +8,7 @@
#
import strutils except Letters
import lexbase, streams
import ".." / [ast, msgs, lineinfos, idents, options, linter]
from os import splitFile
proc replaceDeprecated*(conf: ConfigRef; info: TLineInfo; oldSym, newSym: PIdent) =
let line = sourceLine(conf, info)

View file

@ -10,8 +10,7 @@
# this unit handles Nim sets; it implements symbolic sets
import
ast, astalgo, trees, nversion, lineinfos, platform, bitsets, types, renderer,
options
ast, astalgo, lineinfos, bitsets, types, options
proc inSet*(s: PNode, elem: PNode): bool =
assert s.kind == nkCurly

View file

@ -8,7 +8,7 @@
#
import
os, strutils, strtabs, osproc, sets, lineinfos, platform,
os, strutils, strtabs, sets, lineinfos, platform,
prefixmatches, pathutils
from terminal import isatty

View file

@ -10,7 +10,7 @@
## This module implements the pattern matching features for term rewriting
## macro support.
import strutils, ast, astalgo, types, msgs, idents, renderer, wordrecg, trees,
import strutils, ast, types, msgs, idents, renderer, wordrecg, trees,
options
# we precompile the pattern here for efficiency into some internal

View file

@ -27,7 +27,7 @@ when isMainModule:
outp.close
import
llstream, lexer, idents, strutils, ast, astalgo, msgs, options, lineinfos,
llstream, lexer, idents, strutils, ast, msgs, options, lineinfos,
pathutils
when defined(nimpretty):

View file

@ -10,7 +10,7 @@
## implements some little helper passes
import
strutils, ast, astalgo, passes, idents, msgs, options, idgen, lineinfos
ast, passes, idents, msgs, options, idgen, lineinfos
from modulegraphs import ModuleGraph, PPassContext

View file

@ -11,9 +11,9 @@
## `TPass` interface.
import
strutils, options, ast, astalgo, llstream, msgs, platform, os,
condsyms, idents, renderer, types, extccomp, math, magicsys, nversion,
nimsets, syntaxes, times, idgen, modulegraphs, reorder, rod,
options, ast, llstream, msgs,
idents,
syntaxes, idgen, modulegraphs, reorder, rod,
lineinfos, pathutils
type

View file

@ -10,7 +10,7 @@
## Path handling utilities for Nim. Strictly typed code in order
## to avoid the never ending time sink in getting path handling right.
import os, strutils, pathnorm
import os, pathnorm
type
AbsoluteFile* = distinct string

View file

@ -11,8 +11,7 @@
## macro support.
import
ast, astalgo, types, semdata, sigmatch, msgs, idents, aliases, parampatterns,
trees
ast, types, semdata, sigmatch, idents, aliases, parampatterns, trees
type
TPatternContext = object

View file

@ -9,9 +9,7 @@
## Plugin to transform an inline iterator into a data structure.
import ".." / [ast, astalgo,
magicsys, lookups, semdata,
lambdalifting, msgs]
import ".." / [ast, lookups, semdata, lambdalifting, msgs]
proc iterToProcImpl*(c: PContext, n: PNode): PNode =
result = newNodeI(nkStmtList, n.info)

View file

@ -9,7 +9,7 @@
## The builtin 'system.locals' implemented as a plugin.
import ".." / [pluginsupport, ast, astalgo,
import ".." / [ast, astalgo,
magicsys, lookups, semdata, lowerings]
proc semLocals*(c: PContext, n: PNode): PNode =

View file

@ -1,7 +1,7 @@
import
intsets, ast, idents, algorithm, renderer, parser, os, strutils,
sequtils, msgs, modulegraphs, syntaxes, options, modulepaths, tables,
intsets, ast, idents, algorithm, renderer, os, strutils,
msgs, modulegraphs, syntaxes, options, modulepaths,
lineinfos
type

View file

@ -9,7 +9,7 @@
## This module implements the canonalization for the various caching mechanisms.
import ast, idgen, lineinfos, msgs, incremental, modulegraphs, pathutils
import ast, idgen, lineinfos, incremental, modulegraphs, pathutils
when not nimIncremental:
template setupModuleCache*(g: ModuleGraph) = discard

View file

@ -11,9 +11,10 @@
## language.
import
ast, modules, idents, passes, passaux, condsyms,
options, nimconf, sem, semdata, llstream, vm, vmdef, commands, msgs,
os, times, osproc, wordrecg, strtabs, modulegraphs, lineinfos, pathutils
ast, modules, idents, passes, condsyms,
options, sem, llstream, vm, vmdef, commands, msgs,
os, times, osproc, wordrecg, strtabs, modulegraphs,
lineinfos, pathutils
# we support 'cmpIgnoreStyle' natively for efficiency:
from strutils import cmpIgnoreStyle, contains

View file

@ -10,13 +10,13 @@
# This module implements the semantic checking pass.
import
ast, strutils, hashes, options, lexer, astalgo, trees, treetab,
wordrecg, ropes, msgs, os, condsyms, idents, renderer, types, platform, math,
magicsys, parser, nversion, nimsets, semfold, modulepaths, importer,
ast, strutils, options, astalgo, trees,
wordrecg, ropes, msgs, idents, renderer, types, platform, math,
magicsys, nversion, nimsets, semfold, modulepaths, importer,
procfind, lookups, pragmas, passes, semdata, semtypinst, sigmatch,
intsets, transf, vmdef, vm, idgen, aliases, cgmeth, lambdalifting,
evaltempl, patterns, parampatterns, sempass2, linter, semmacrosanity,
lowerings, pluginsupport, plugins/active, rod, lineinfos, strtabs, int128
lowerings, plugins/active, rod, lineinfos, strtabs, int128
from modulegraphs import ModuleGraph, PPassContext, onUse, onDef, onDefResolveForward

View file

@ -10,11 +10,8 @@
## This module contains the data structures for the semantic checking phase.
import
strutils, intsets, options, lexer, ast, astalgo, trees, treetab,
wordrecg,
ropes, msgs, platform, os, condsyms, idents, renderer, types, extccomp, math,
magicsys, nversion, nimsets, parser, times, passes, vmdef,
modulegraphs, lineinfos
intsets, options, ast, astalgo, msgs, idents, renderer,
magicsys, passes, vmdef, modulegraphs, lineinfos
type
TOptionEntry* = object # entries to put on a stack for pragma parsing

View file

@ -11,8 +11,8 @@
# and evaluation phase
import
strutils, options, ast, astalgo, trees, treetab, nimsets,
nversion, platform, math, msgs, os, condsyms, idents, renderer, types,
strutils, options, ast, trees, nimsets,
platform, math, msgs, idents, renderer, types,
commands, magicsys, modulegraphs, strtabs, lineinfos
proc newIntNodeT*(intVal: BiggestInt, n: PNode; g: ModuleGraph): PNode =

View file

@ -10,7 +10,7 @@
## Implements type sanity checking for ASTs resulting from macros. Lots of
## room for improvement here.
import ast, astalgo, msgs, types, options
import ast, msgs, types, options
proc ithField(n: PNode, field: var int): PSym =
result = nil

View file

@ -10,7 +10,7 @@
import
intsets, ast, astalgo, msgs, renderer, magicsys, types, idents, trees,
wordrecg, strutils, options, guards, lineinfos, semfold, semdata,
modulegraphs, lowerings, sigmatch, tables
modulegraphs
when not defined(leanCompiler):
import writetracking

View file

@ -11,9 +11,7 @@
import ast, tables, ropes, md5, modulegraphs
from hashes import Hash
from astalgo import debug
import types
from strutils import startsWith, contains
proc `&=`(c: var MD5Context, s: string) = md5Update(c, s, s.len)
proc `&=`(c: var MD5Context, ch: char) = md5Update(c, unsafeAddr ch, 1)

View file

@ -12,7 +12,7 @@
import
intsets, ast, astalgo, semdata, types, msgs, renderer, lookups, semtypinst,
magicsys, condsyms, idents, lexer, options, parampatterns, strutils, trees,
magicsys, idents, lexer, options, parampatterns, strutils, trees,
linter, lineinfos, lowerings, modulegraphs
when (defined(booting) or defined(nimsuggest)) and not defined(leanCompiler):

View file

@ -9,8 +9,8 @@
## This module implements threadpool's ``spawn``.
import ast, astalgo, types, idents, magicsys, msgs, options, modulegraphs,
lineinfos, lowerings
import ast, types, idents, magicsys, msgs, options, modulegraphs,
lowerings
from trees import getMagic
proc callProc(a: PNode): PNode =

View file

@ -32,11 +32,11 @@
# included from sigmatch.nim
import algorithm, prefixmatches, lineinfos, pathutils, parseutils, linter
import algorithm, prefixmatches, lineinfos, parseutils, linter
from wordrecg import wDeprecated, wError, wAddr, wYield, specialWords
when defined(nimsuggest):
import passes, tables # importer
import passes, tables, pathutils # importer
const
sep = '\t'

View file

@ -10,7 +10,7 @@
## Implements the dispatcher for the different parsers.
import
strutils, llstream, ast, astalgo, idents, lexer, options, msgs, parser,
strutils, llstream, ast, idents, lexer, options, msgs, parser,
filters, filter_tmpl, renderer, lineinfos, pathutils
type

View file

@ -19,9 +19,9 @@
# * transforms 'defer' into a 'try finally' statement
import
intsets, strutils, options, ast, astalgo, trees, treetab, msgs, lookups,
options, ast, astalgo, trees, msgs,
idents, renderer, types, passes, semfold, magicsys, cgmeth,
sempass2, lowerings, injectdestructors, liftlocals,
lowerings, injectdestructors, liftlocals,
modulegraphs, lineinfos
proc transformBody*(g: ModuleGraph, prc: PSym, cache = true;

View file

@ -10,7 +10,7 @@
# tree helper routines
import
ast, astalgo, lexer, msgs, strutils, wordrecg, idents
ast, wordrecg, idents
proc cyclicTreeAux(n: PNode, visited: var seq[PNode]): bool =
if n == nil: return

View file

@ -7,7 +7,7 @@
# distribution, for details about the copyright.
#
import renderer, strutils, ast, msgs, types, astalgo
import renderer, strutils, ast, types
const defaultParamSeparator* = ","

View file

@ -13,7 +13,7 @@
import ast except getstr
import
strutils, astalgo, msgs, vmdef, vmgen, nimsets, types, passes,
strutils, msgs, vmdef, vmgen, nimsets, types, passes,
parser, vmdeps, idents, trees, renderer, options, transf, parseutils,
vmmarshal, gorgeimpl, lineinfos, tables, btrees, macrocacheimpl,
modulegraphs, sighashes

View file

@ -10,8 +10,7 @@
## This module contains the type definitions for the new evaluation engine.
## An instruction is 1-3 int32s in memory, it is a register based VM.
import ast, passes, msgs, idents, intsets, options, modulegraphs, lineinfos,
tables, btrees
import ast, passes, idents, intsets, options, modulegraphs, lineinfos
const
byteExcess* = 128 # we use excess-K for immediates

View file

@ -7,7 +7,7 @@
# distribution, for details about the copyright.
#
import ast, types, msgs, os, streams, options, idents, lineinfos
import ast, types, msgs, os, options, idents, lineinfos
proc opSlurp*(file: string, info: TLineInfo, module: PSym; conf: ConfigRef): string =
try:

View file

@ -28,10 +28,8 @@
# this copy depends on the involved types.
import
strutils, ast, astalgo, types, msgs, renderer, vmdef,
trees, intsets, magicsys, options, lowerings, lineinfos, transf
import platform
from os import splitFile
strutils, ast, types, msgs, renderer, vmdef,
intsets, magicsys, options, lowerings, lineinfos, transf
const
debugEchoCode* = defined(nimVMDebug)

View file

@ -15,8 +15,7 @@
## * Computing an aliasing relation based on the assignments. This relation
## is then used to compute the 'writes' and 'escapes' effects.
import intsets, idents, ast, astalgo, trees, renderer, msgs, types, options,
lineinfos
import intsets, idents, ast, trees, msgs, types, options, lineinfos
const
debug = false

View file

@ -20,7 +20,7 @@
import
hashes, math
hashes
type
BitScalar = uint

View file

@ -11,10 +11,8 @@
include "system/inclrtl"
import strutils, os
when not defined(windows):
import posix
import strutils, posix, os
when defined(linux):
import linux

View file

@ -44,10 +44,6 @@
## * `std/sha1 module <sha1.html>`_ for a sha1 encoder and decoder
## * `tables module <tables.html>`_ for hash tables
import
strutils
type
Hash* = int ## A hash value. Hash tables using these values should
## always have a size of a power of two and can use the ``and``

View file

@ -142,8 +142,8 @@ runnableExamples:
doAssert $(%* Foo()) == """{"a1":0,"a2":0,"a0":0,"a3":0,"a4":0}"""
import
hashes, tables, strutils, lexbase, streams, unicode, macros, parsejson,
typetraits, options
hashes, tables, strutils, lexbase, streams, macros, parsejson,
options
export
tables.`$`

View file

@ -1849,7 +1849,7 @@ proc expandFilename*(filename: string): string {.rtl, extern: "nos$1",
break
# getFullPathName doesn't do case corrections, so we have to use this convoluted
# way of retrieving the true filename
for x in walkFiles(result.string):
for x in walkFiles(result):
result = x
if not existsFile(result) and not existsDir(result):
raise newException(OSError, "file '" & result & "' does not exist")

View file

@ -19,7 +19,7 @@
import macros
import strformat
from strutils import toLowerAscii, `%`
import colors, tables
import colors
when defined(windows):
import winlean