Merge pull request #12613 from nim-lang/miran-unused-imports
Remove unused imports
This commit is contained in:
commit
675189c77f
23 changed files with 22 additions and 46 deletions
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
|
|
||||||
import
|
import
|
||||||
intsets, ast, astalgo, msgs, renderer, magicsys, types, idents,
|
intsets, ast, msgs, renderer, magicsys, types, idents,
|
||||||
strutils, options, dfa, lowerings, tables, modulegraphs, msgs,
|
strutils, options, dfa, lowerings, tables, modulegraphs, msgs,
|
||||||
lineinfos, parampatterns, sighashes
|
lineinfos, parampatterns, sighashes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
# This module implements semantic checking for pragmas
|
# This module implements semantic checking for pragmas
|
||||||
|
|
||||||
import
|
import
|
||||||
os, platform, condsyms, ast, astalgo, idents, semdata, msgs, renderer,
|
os, condsyms, ast, astalgo, idents, semdata, msgs, renderer,
|
||||||
wordrecg, ropes, options, strutils, extccomp, math, magicsys, trees,
|
wordrecg, ropes, options, strutils, extccomp, math, magicsys, trees,
|
||||||
types, lookups, lineinfos, pathutils, linter
|
types, lookups, lineinfos, pathutils, linter
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,6 @@ import
|
||||||
wordrecg, strutils, options, guards, lineinfos, semfold, semdata,
|
wordrecg, strutils, options, guards, lineinfos, semfold, semdata,
|
||||||
modulegraphs
|
modulegraphs
|
||||||
|
|
||||||
when not defined(leanCompiler):
|
|
||||||
import writetracking
|
|
||||||
|
|
||||||
when defined(useDfa):
|
when defined(useDfa):
|
||||||
import dfa
|
import dfa
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,6 @@ import
|
||||||
magicsys, idents, lexer, options, parampatterns, strutils, trees,
|
magicsys, idents, lexer, options, parampatterns, strutils, trees,
|
||||||
linter, lineinfos, lowerings, modulegraphs
|
linter, lineinfos, lowerings, modulegraphs
|
||||||
|
|
||||||
when (defined(booting) or defined(nimsuggest)) and not defined(leanCompiler):
|
|
||||||
import docgen
|
|
||||||
|
|
||||||
type
|
type
|
||||||
MismatchKind* = enum
|
MismatchKind* = enum
|
||||||
kUnknown, kAlreadyGiven, kUnknownNamedParam, kTypeMismatch, kVarNeeded,
|
kUnknown, kAlreadyGiven, kUnknownNamedParam, kTypeMismatch, kVarNeeded,
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,7 @@
|
||||||
include "system/inclrtl"
|
include "system/inclrtl"
|
||||||
|
|
||||||
when not defined(windows):
|
when not defined(windows):
|
||||||
import strutils, posix, os
|
import posix
|
||||||
|
|
||||||
when defined(linux):
|
|
||||||
import linux
|
|
||||||
|
|
||||||
when defined(freebsd) or defined(macosx):
|
when defined(freebsd) or defined(macosx):
|
||||||
{.emit:"#include <sys/types.h>".}
|
{.emit:"#include <sys/types.h>".}
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
when not declared(os) and not declared(ospaths):
|
when not declared(os) and not declared(ospaths):
|
||||||
{.error: "This is an include file for os.nim!".}
|
{.error: "This is an include file for os.nim!".}
|
||||||
|
|
||||||
from parseutils import skipIgnoreCase
|
when defined(windows):
|
||||||
|
from parseutils import skipIgnoreCase
|
||||||
|
|
||||||
proc c_getenv(env: cstring): cstring {.
|
proc c_getenv(env: cstring): cstring {.
|
||||||
importc: "getenv", header: "<stdlib.h>".}
|
importc: "getenv", header: "<stdlib.h>".}
|
||||||
|
|
|
||||||
|
|
@ -27,9 +27,6 @@ when defined(windows):
|
||||||
else:
|
else:
|
||||||
import posix
|
import posix
|
||||||
|
|
||||||
when defined(linux):
|
|
||||||
import linux
|
|
||||||
|
|
||||||
type
|
type
|
||||||
ProcessOption* = enum ## Options that can be passed to `startProcess proc
|
ProcessOption* = enum ## Options that can be passed to `startProcess proc
|
||||||
## <#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]>`_.
|
## <#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]>`_.
|
||||||
|
|
|
||||||
|
|
@ -151,8 +151,7 @@
|
||||||
|
|
||||||
include "system/inclrtl"
|
include "system/inclrtl"
|
||||||
|
|
||||||
import
|
import os
|
||||||
os, strutils
|
|
||||||
|
|
||||||
type
|
type
|
||||||
CmdLineKind* = enum ## The detected command line token.
|
CmdLineKind* = enum ## The detected command line token.
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,9 @@ import strutils, os, parseopt, parseutils, sequtils, net, rdstdin, sexp
|
||||||
# suggestionResultHook, because suggest.nim is included by sigmatch.
|
# suggestionResultHook, because suggest.nim is included by sigmatch.
|
||||||
# So we import that one instead.
|
# So we import that one instead.
|
||||||
import compiler / [options, commands, modules, sem,
|
import compiler / [options, commands, modules, sem,
|
||||||
passes, passaux, msgs, nimconf,
|
passes, passaux, msgs,
|
||||||
extccomp, condsyms,
|
sigmatch, ast,
|
||||||
sigmatch, ast, scriptconfig,
|
idents, modulegraphs, prefixmatches, lineinfos, cmdlinehelper,
|
||||||
idents, modulegraphs, vm, prefixmatches, lineinfos, cmdlinehelper,
|
|
||||||
pathutils]
|
pathutils]
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ discard """
|
||||||
|
|
||||||
# bug #5079
|
# bug #5079
|
||||||
|
|
||||||
import tables, strutils
|
import tables
|
||||||
|
|
||||||
type Test = ref object
|
type Test = ref object
|
||||||
s: string
|
s: string
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,7 @@ foo = bar # No error if assigned directly
|
||||||
|
|
||||||
# bug #2250
|
# bug #2250
|
||||||
|
|
||||||
import
|
import math
|
||||||
math, strutils
|
|
||||||
|
|
||||||
type
|
type
|
||||||
Meters = float
|
Meters = float
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ discard """
|
||||||
output: "passed all tests."
|
output: "passed all tests."
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import math, strutils
|
import strutils
|
||||||
|
|
||||||
proc c_sprintf(buf, fmt: cstring) {.importc:"sprintf", header: "<stdio.h>", varargs.}
|
proc c_sprintf(buf, fmt: cstring) {.importc:"sprintf", header: "<stdio.h>", varargs.}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ end
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
import algorithm, math, sequtils, strutils
|
import sequtils, strutils
|
||||||
|
|
||||||
|
|
||||||
block t338:
|
block t338:
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ output: '''
|
||||||
(BracketExpr (Sym "typeDesc") (Sym "User"))
|
(BracketExpr (Sym "typeDesc") (Sym "User"))
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
import strutils, macros
|
import macros
|
||||||
|
|
||||||
type
|
type
|
||||||
Model = object of RootObj
|
Model = object of RootObj
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
discard """
|
discard """
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import macros, strUtils
|
import macros
|
||||||
|
|
||||||
proc symToIdent(x: NimNode): NimNode =
|
proc symToIdent(x: NimNode): NimNode =
|
||||||
case x.kind:
|
case x.kind:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import macros
|
import macros
|
||||||
|
|
||||||
from uri import `/`
|
|
||||||
|
|
||||||
macro test*(a: untyped): untyped =
|
macro test*(a: untyped): untyped =
|
||||||
var nodes: tuple[a, b: int]
|
var nodes: tuple[a, b: int]
|
||||||
nodes.a = 4
|
nodes.a = 4
|
||||||
|
|
@ -22,7 +20,6 @@ macro test*(a: untyped): untyped =
|
||||||
test:
|
test:
|
||||||
"hi"
|
"hi"
|
||||||
|
|
||||||
import strutils
|
|
||||||
|
|
||||||
template assertNot(arg: untyped): untyped =
|
template assertNot(arg: untyped): untyped =
|
||||||
assert(not(arg))
|
assert(not(arg))
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,7 @@ discard """
|
||||||
output: "after"
|
output: "after"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import
|
import macros
|
||||||
macros, strutils
|
|
||||||
|
|
||||||
macro test_macro*(s: string, n: untyped): untyped =
|
macro test_macro*(s: string, n: untyped): untyped =
|
||||||
result = newNimNode(nnkStmtList)
|
result = newNimNode(nnkStmtList)
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@ discard """
|
||||||
{a, b}'''
|
{a, b}'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import
|
import macros
|
||||||
macros, strutils
|
|
||||||
|
|
||||||
macro outterMacro*(n, blck: untyped): untyped =
|
macro outterMacro*(n, blck: untyped): untyped =
|
||||||
let n = callsite()
|
let n = callsite()
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,3 @@
|
||||||
import typetraits
|
|
||||||
|
|
||||||
template reject(e) =
|
template reject(e) =
|
||||||
static: assert(not compiles(e))
|
static: assert(not compiles(e))
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
discard """
|
discard """
|
||||||
output: "3"
|
output: "3"
|
||||||
"""
|
"""
|
||||||
import StrUtils, Math
|
import math
|
||||||
|
|
||||||
proc FibonacciA(n: int): int64 =
|
proc FibonacciA(n: int): int64 =
|
||||||
var fn = float64(n)
|
var fn = float64(n)
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@
|
||||||
#
|
#
|
||||||
import strutils
|
import strutils
|
||||||
import math
|
import math
|
||||||
import macros
|
|
||||||
|
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
|
||||||
|
|
@ -28,13 +28,11 @@ In addition, all command line options of Nim that do not affect code generation
|
||||||
are supported.
|
are supported.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import strutils, os, parseopt, parseutils
|
import strutils, os, parseopt
|
||||||
|
|
||||||
import "../compiler" / [options, commands, modules, sem,
|
import "../compiler" / [options, commands, modules, sem,
|
||||||
passes, passaux, msgs, nimconf,
|
passes, passaux, msgs, ast,
|
||||||
extccomp, condsyms,
|
idents, modulegraphs, lineinfos, cmdlinehelper,
|
||||||
ast, scriptconfig,
|
|
||||||
idents, modulegraphs, vm, prefixmatches, lineinfos, cmdlinehelper,
|
|
||||||
pathutils]
|
pathutils]
|
||||||
|
|
||||||
import db_sqlite
|
import db_sqlite
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ when haveZipLib:
|
||||||
import zipfiles
|
import zipfiles
|
||||||
|
|
||||||
import
|
import
|
||||||
os, osproc, strutils, parseopt, parsecfg, strtabs, streams, debcreation,
|
os, strutils, parseopt, parsecfg, strtabs, streams, debcreation,
|
||||||
std / sha1
|
std / sha1
|
||||||
|
|
||||||
const
|
const
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue