parent
9b9f5dee0b
commit
6c7abe6e5b
12 changed files with 9 additions and 19 deletions
|
|
@ -223,7 +223,7 @@
|
||||||
into the namespace "Nim" in order to avoid naming conflicts with existing
|
into the namespace "Nim" in order to avoid naming conflicts with existing
|
||||||
C++ code. This is done for all Nim code - internal and exported.
|
C++ code. This is done for all Nim code - internal and exported.
|
||||||
|
|
||||||
- Added ``macros.getProjectPath`` and ``ospaths.putEnv`` procs to Nim's virtual
|
- Added ``macros.getProjectPath`` and ``os.putEnv`` procs to Nim's virtual
|
||||||
machine.
|
machine.
|
||||||
|
|
||||||
- The ``deadCodeElim`` option is now always turned on and the switch has no
|
- The ``deadCodeElim`` option is now always turned on and the switch has no
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,6 @@ template mathop(op) {.dirty.} =
|
||||||
template osop(op) {.dirty.} =
|
template osop(op) {.dirty.} =
|
||||||
registerCallback(c, "stdlib.os." & astToStr(op), `op Wrapper`)
|
registerCallback(c, "stdlib.os." & astToStr(op), `op Wrapper`)
|
||||||
|
|
||||||
template ospathsop(op) {.dirty.} =
|
|
||||||
registerCallback(c, "stdlib.ospaths." & astToStr(op), `op Wrapper`)
|
|
||||||
|
|
||||||
template systemop(op) {.dirty.} =
|
template systemop(op) {.dirty.} =
|
||||||
registerCallback(c, "stdlib.system." & astToStr(op), `op Wrapper`)
|
registerCallback(c, "stdlib.system." & astToStr(op), `op Wrapper`)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ async dom96
|
||||||
strutils araq
|
strutils araq
|
||||||
sequtils dom96, araq
|
sequtils dom96, araq
|
||||||
times GULPF
|
times GULPF
|
||||||
os, ospaths dom96, araq
|
os dom96, araq
|
||||||
re araq
|
re araq
|
||||||
nre flaviu
|
nre flaviu
|
||||||
math, fenv krux02, cooldome
|
math, fenv krux02, cooldome
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ There are 3 types of tests:
|
||||||
2. tests in ``when isMainModule:`` block, ran by ``nim c mymod.nim``
|
2. tests in ``when isMainModule:`` block, ran by ``nim c mymod.nim``
|
||||||
``nimble test`` also typially runs these in external nimble packages.
|
``nimble test`` also typially runs these in external nimble packages.
|
||||||
|
|
||||||
3. testament tests, eg: tests/stdlib/tospaths.nim (only used for Nim repo).
|
3. testament tests, eg: tests/stdlib/tos.nim (only used for Nim repo).
|
||||||
|
|
||||||
Not all the tests follow the convention here, feel free to change the ones
|
Not all the tests follow the convention here, feel free to change the ones
|
||||||
that don't. Always leave the code cleaner than you found it.
|
that don't. Always leave the code cleaner than you found it.
|
||||||
|
|
@ -30,7 +30,7 @@ that don't. Always leave the code cleaner than you found it.
|
||||||
Stdlib
|
Stdlib
|
||||||
------
|
------
|
||||||
|
|
||||||
If you change the stdlib (anything under ``lib/``, eg ``lib/pure/ospaths.nim``),
|
If you change the stdlib (anything under ``lib/``, eg ``lib/pure/os.nim``),
|
||||||
put a test in the file you changed. Add the tests under a ``when isMainModule:``
|
put a test in the file you changed. Add the tests under a ``when isMainModule:``
|
||||||
condition so they only get executed when the tester is building the
|
condition so they only get executed when the tester is building the
|
||||||
file. Each test should be in a separate ``block:`` statement, such that
|
file. Each test should be in a separate ``block:`` statement, such that
|
||||||
|
|
@ -53,7 +53,7 @@ Sample test:
|
||||||
doAssert: not 1 == 2
|
doAssert: not 1 == 2
|
||||||
|
|
||||||
Newer tests tend to be run via ``testament`` rather than via ``when isMainModule:``,
|
Newer tests tend to be run via ``testament`` rather than via ``when isMainModule:``,
|
||||||
eg ``tests/stdlib/tospaths.nim``; this allows additional features such as custom
|
eg ``tests/stdlib/tos.nim``; this allows additional features such as custom
|
||||||
compiler flags; for more details see below.
|
compiler flags; for more details see below.
|
||||||
|
|
||||||
Compiler
|
Compiler
|
||||||
|
|
@ -197,7 +197,7 @@ as well as ``testament`` and guarantee they stay in sync.
|
||||||
|
|
||||||
result = a & "Bar"
|
result = a & "Bar"
|
||||||
|
|
||||||
See `parentDir <https://nim-lang.github.io/Nim/ospaths.html#parentDir%2Cstring>`_
|
See `parentDir <https://nim-lang.github.io/Nim/os.html#parentDir%2Cstring>`_
|
||||||
example.
|
example.
|
||||||
|
|
||||||
The RestructuredText Nim uses has a special syntax for including code snippets
|
The RestructuredText Nim uses has a special syntax for including code snippets
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ available. So the stdlib modules using ``importc`` cannot be used with
|
||||||
Nim's VM. However, at least the following modules are available:
|
Nim's VM. However, at least the following modules are available:
|
||||||
|
|
||||||
* `macros <macros.html>`_
|
* `macros <macros.html>`_
|
||||||
* `ospaths <ospaths.html>`_
|
* `os <os.html>`_
|
||||||
* `strutils <strutils.html>`_
|
* `strutils <strutils.html>`_
|
||||||
* `math <math.html>`_
|
* `math <math.html>`_
|
||||||
* `distros <distros.html>`_
|
* `distros <distros.html>`_
|
||||||
|
|
|
||||||
|
|
@ -1934,8 +1934,6 @@ proc moveDir*(source, dest: string) {.tags: [ReadIOEffect, WriteIOEffect], noNim
|
||||||
copyDir(source, dest)
|
copyDir(source, dest)
|
||||||
removeDir(source)
|
removeDir(source)
|
||||||
|
|
||||||
#include ospaths
|
|
||||||
|
|
||||||
proc expandSymlink*(symlinkPath: string): string {.noNimScript.} =
|
proc expandSymlink*(symlinkPath: string): string {.noNimScript.} =
|
||||||
## Returns a string representing the path to which the symbolic link points.
|
## Returns a string representing the path to which the symbolic link points.
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ include "system/inclrtl"
|
||||||
import
|
import
|
||||||
strutils, os, strtabs, streams, cpuinfo
|
strutils, os, strtabs, streams, cpuinfo
|
||||||
|
|
||||||
#from ospaths import quoteShell, quoteShellWindows, quoteShellPosix
|
|
||||||
export quoteShell, quoteShellWindows, quoteShellPosix
|
export quoteShell, quoteShellWindows, quoteShellPosix
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
from strutils import endsWith, split
|
from strutils import endsWith, split
|
||||||
from ospaths import isAbsolute
|
from os import isAbsolute
|
||||||
|
|
||||||
proc checkMsg*(msg, expectedEnd, name: string)=
|
proc checkMsg*(msg, expectedEnd, name: string)=
|
||||||
let filePrefix = msg.split(' ', maxSplit = 1)[0]
|
let filePrefix = msg.split(' ', maxSplit = 1)[0]
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,6 @@ mode = ScriptMode.Whatif
|
||||||
|
|
||||||
exec "gcc -v"
|
exec "gcc -v"
|
||||||
|
|
||||||
# test that ospaths actually compiles:
|
|
||||||
import ospaths
|
|
||||||
|
|
||||||
--forceBuild
|
--forceBuild
|
||||||
--path: "../friends"
|
--path: "../friends"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
# bug #4462
|
# bug #4462
|
||||||
import macros
|
import macros
|
||||||
import os
|
import os
|
||||||
import ospaths
|
|
||||||
import strutils
|
import strutils
|
||||||
|
|
||||||
block:
|
block:
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ doc/manual/var_t_return.rst
|
||||||
doc = """
|
doc = """
|
||||||
lib/system.nim
|
lib/system.nim
|
||||||
lib/system/nimscript.nim
|
lib/system/nimscript.nim
|
||||||
lib/pure/ospaths.nim
|
lib/deprecated/pure/ospaths.nim
|
||||||
lib/pure/parsejson.nim
|
lib/pure/parsejson.nim
|
||||||
lib/pure/cstrutils.nim
|
lib/pure/cstrutils.nim
|
||||||
lib/core/macros.nim
|
lib/core/macros.nim
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue