Skip to content

Commit

Permalink
Merge pull request #6 from arnetheduck/imports
Browse files Browse the repository at this point in the history
use $nim-relative imports
  • Loading branch information
arnetheduck committed Dec 11, 2023
2 parents 862fa02 + f559e73 commit b8fb2d7
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 23 deletions.
3 changes: 0 additions & 3 deletions config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
when withDir(thisDir(), system.fileExists("nimble.paths")):
include "nimble.paths"
# end Nimble config

switch("p", "$projectDir/nimbledeps/pkgs2/nim-2.0.0-35b9d926d314ce8c3326902c138f5c2247cfd390/compiler")
switch("p", "$projectDir/../nimbledeps/pkgs2/nim-2.0.0-35b9d926d314ce8c3326902c138f5c2247cfd390/compiler")
3 changes: 2 additions & 1 deletion src/nph.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

import
"."/[astcmp, phast, phastalgo, phmsgs, phlineinfos, phoptions, phparser, phrenderer]
import idents
import
"$nim"/compiler/idents

from "$nim"/compiler/astalgo import nil

Expand Down
7 changes: 5 additions & 2 deletions src/phast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@
# nph version:
# * enhanced concrete syntax information

import hashes, options, ropes, idents, int128, tables
import
std/[hashes, tables]
import
"$nim"/compiler/[idents, options, int128, ropes]

from strutils import toLowerAscii
from std/strutils import toLowerAscii

import
"."/phlineinfos
Expand Down
5 changes: 4 additions & 1 deletion src/phastalgo.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
# nph version:
# * yaml formatting for the nph-specific fields

import phast, hashes, intsets, phoptions, phlineinfos, ropes, idents, rodutils, phmsgs
import
"."/[phast, phoptions, phlineinfos, phmsgs],
std/[hashes, intsets],
"$nim"/compiler/[ropes, idents, rodutils]

import strutils except addf
when defined(nimPreviewSlimSystem):
Expand Down
5 changes: 3 additions & 2 deletions src/phlexer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
# end-of-comment marker.

import
hashes, phoptions, phmsgs, strutils, platform, idents, nimlexbase, llstream, wordrecg,
phlineinfos, pathutils, parseutils
"$nim"/compiler/[idents, platform, nimlexbase, llstream, pathutils, wordrecg],
"."/[phoptions, phmsgs, phlineinfos],
std/[hashes, strutils, parseutils]
when defined(nimPreviewSlimSystem):
import
std/[assertions, formatfloat]
Expand Down
3 changes: 2 additions & 1 deletion src/phlineinfos.nim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
## This module contains the ``TMsgKind`` enum as well as the
## ``TLineInfo`` object.

import ropes, tables, pathutils, hashes
import
"$nim"/compiler/[ropes, pathutils], std/[hashes, tables]

const
explanationsBaseUrl* = "https://nim-lang.github.io/Nim"
Expand Down
7 changes: 3 additions & 4 deletions src/phmsgs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
import
std/[strutils, os, tables, terminal, macros, times],
std/private/miscdollars,
pathutils
import
./phlineinfos, ./phoptions
"$nim"/compiler/pathutils,
"."/[phlineinfos, phoptions]

import ropes except `%`
import "$nim"/compiler/ropes except `%`
when defined(nimPreviewSlimSystem):
import
std/[syncio, assertions]
Expand Down
15 changes: 9 additions & 6 deletions src/phoptions.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
# distribution, for details about the copyright.
#

import os, strutils, strtabs, sets, platform, prefixmatches, pathutils, nimpaths, tables
import phlineinfos

from terminal import isatty
from times import utc, fromUnix, local, getTime, format, DateTime
import
std/[os, strutils, strtabs, sets, tables],
"$nim"/compiler/[platform, prefixmatches, pathutils, nimpaths]
import
./phlineinfos

from std/terminal import isatty
from std/times import utc, fromUnix, local, getTime, format, DateTime
from std/private/globs import nativeToUnixPath
when defined(nimPreviewSlimSystem):
import
Expand Down Expand Up @@ -901,7 +904,7 @@ proc clearNimblePath*(conf: ConfigRef) =
conf.nimblePaths.setLen(0)

include
packagehandling
"$nim"/compiler/packagehandling

proc getOsCacheDir(): string =
when defined(posix):
Expand Down
3 changes: 2 additions & 1 deletion src/phparser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
# that the lexer is trying to do comment layout / reflow / analysis in the
# middle of lexing..

import llstream, idents, strutils, pathutils
import
"$nim"/compiler/[llstream, idents, pathutils], std/[strutils]
import
"."/[phast, phlexer, phlineinfos, phmsgs, phoptions]
when defined(nimPreviewSlimSystem):
Expand Down
6 changes: 4 additions & 2 deletions src/phrenderer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@

{.used.}

import idents, strutils, sequtils
import phlexer, phoptions, phast, phmsgs, phlineinfos
import
"$nim"/compiler/[idents], std/[strutils, sequtils]
import
"."/[phlexer, phoptions, phast, phmsgs, phlineinfos]
when defined(nimPreviewSlimSystem):
import
std/[syncio, assertions, formatfloat]
Expand Down

0 comments on commit b8fb2d7

Please sign in to comment.