complete std prefixes for stdlib (#22887)

follow up https://github.com/nim-lang/Nim/pull/22851
follow up https://github.com/nim-lang/Nim/pull/22873
This commit is contained in:
ringabout
2023-10-31 00:03:04 +08:00
committed by GitHub
parent 403e0118ae
commit 4d11d0619d
142 changed files with 277 additions and 275 deletions

View File

@@ -4,9 +4,9 @@ this can eventually be moved to std/os and `walkDirRec` can be implemented in te
to avoid duplication
]##
import os
import std/os
when defined(windows):
from strutils import replace
from std/strutils import replace
when defined(nimPreviewSlimSystem):
import std/[assertions, objectdollar]
@@ -65,6 +65,6 @@ proc nativeToUnixPath*(path: string): string =
result = replace(result, '\\', '/')
when isMainModule:
import sugar
import std/sugar
for a in walkDirRecFilter(".", follow = a=>a.path.lastPathPart notin ["nimcache", ".git", "csources_v1", "csources", "bin"]):
echo a

View File

@@ -22,9 +22,9 @@ type
when weirdTarget:
discard
elif defined(windows):
import winlean, times
import std/[winlean, times]
elif defined(posix):
import posix
import std/posix
proc c_rename(oldname, newname: cstring): cint {.
importc: "rename", header: "<stdio.h>".}
else:

View File

@@ -16,9 +16,9 @@ when defined(nimPreviewSlimSystem):
when weirdTarget:
discard
elif defined(windows):
import winlean, times
import std/[winlean, times]
elif defined(posix):
import posix, times
import std/[posix, times]
else:
{.error: "OS module not ported to your operating system!".}

View File

@@ -15,9 +15,9 @@ when defined(nimPreviewSlimSystem):
when weirdTarget:
discard
elif defined(windows):
import winlean
import std/winlean
elif defined(posix):
import posix, times
import std/[posix, times]
proc toTime(ts: Timespec): times.Time {.inline.} =
result = initTime(ts.tv_sec.int64, ts.tv_nsec.int)

View File

@@ -1,7 +1,7 @@
include system/inclrtl
import std/private/since
import strutils, pathnorm
import std/[strutils, pathnorm]
import std/oserrors
import oscommon
@@ -17,9 +17,9 @@ const weirdTarget = defined(nimscript) or defined(js)
when weirdTarget:
discard
elif defined(windows):
import winlean
import std/winlean
elif defined(posix):
import posix, system/ansi_c
import std/posix, system/ansi_c
else:
{.error: "OS module not ported to your operating system!".}

View File

@@ -10,9 +10,9 @@ when defined(nimPreviewSlimSystem):
when weirdTarget:
discard
elif defined(windows):
import winlean, times
import std/[winlean, times]
elif defined(posix):
import posix
import std/posix
else:
{.error: "OS module not ported to your operating system!".}

View File

@@ -10,7 +10,7 @@
## This is an internal helper module. Do not use.
import macros
import std/macros
proc underscoredCalls*(result, calls, arg0: NimNode)