mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
Undefine paramCount & paramStr in nimscript.nim for *.nims (#12860)
* Remove `paramStr` and `paramCount` from implicitly imported nimscript.nim * Update changelog.md * Update stable nimble commit hash Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
|
||||
- Added high-level `asyncnet.sendTo` and `asyncnet.recvFrom`. UDP functionality.
|
||||
|
||||
- `paramCount` & `paramStr` are now defined in os.nim instead of nimscript.nim for nimscript/nimble.
|
||||
- `dollars.$` now works for unsigned ints with `nim js`
|
||||
|
||||
## Language changes
|
||||
|
||||
@@ -141,10 +141,12 @@ proc setupVM*(module: PSym; cache: IdentCache; scriptName: string;
|
||||
setResult(a, options.existsConfigVar(conf, a.getString 0))
|
||||
cbconf nimcacheDir:
|
||||
setResult(a, options.getNimcacheDir(conf).string)
|
||||
cbconf paramStr:
|
||||
setResult(a, os.paramStr(int a.getInt 0))
|
||||
cbconf paramCount:
|
||||
setResult(a, os.paramCount())
|
||||
result.registerCallback "stdlib.os." & astToStr(paramStr),
|
||||
proc (a: VmArgs) =
|
||||
setResult(a, os.paramStr(int a.getInt 0))
|
||||
result.registerCallback "stdlib.os." & astToStr(paramCount),
|
||||
proc (a: VmArgs) =
|
||||
setResult(a, os.paramCount())
|
||||
cbconf cmpIgnoreStyle:
|
||||
setResult(a, strutils.cmpIgnoreStyle(a.getString 0, a.getString 1))
|
||||
cbconf cmpIgnoreCase:
|
||||
|
||||
2
koch.nim
2
koch.nim
@@ -10,7 +10,7 @@
|
||||
#
|
||||
|
||||
const
|
||||
NimbleStableCommit = "4007b2a778429a978e12307bf13a038029b4c4d9" # master
|
||||
NimbleStableCommit = "6f2b1ace922e565f7f48a69648e16a002a5d15e3" # master
|
||||
|
||||
when not defined(windows):
|
||||
const
|
||||
|
||||
@@ -2707,7 +2707,23 @@ when defined(nimdoc):
|
||||
## else:
|
||||
## # Do something else!
|
||||
|
||||
elif defined(nintendoswitch) or weirdTarget:
|
||||
elif defined(nimscript):
|
||||
proc paramStr*(i: int): string =
|
||||
## Retrieves the ``i``'th command line parameter.
|
||||
discard
|
||||
|
||||
proc paramCount*(): int =
|
||||
## Retrieves the number of command line parameters.
|
||||
discard
|
||||
|
||||
elif defined(js):
|
||||
proc paramStr*(i: int): TaintedString {.tags: [ReadIOEffect].} =
|
||||
raise newException(OSError, "paramStr is not implemented on JavaScript")
|
||||
|
||||
proc paramCount*(): int {.tags: [ReadIOEffect].} =
|
||||
raise newException(OSError, "paramCount is not implemented on JavaScript")
|
||||
|
||||
elif defined(nintendoswitch):
|
||||
proc paramStr*(i: int): TaintedString {.tags: [ReadIOEffect].} =
|
||||
raise newException(OSError, "paramStr is not implemented on Nintendo Switch")
|
||||
|
||||
|
||||
@@ -56,14 +56,6 @@ proc rawExec(cmd: string): int {.tags: [ExecIOEffect], raises: [OSError].} =
|
||||
proc warningImpl(arg, orig: string) = discard
|
||||
proc hintImpl(arg, orig: string) = discard
|
||||
|
||||
proc paramStr*(i: int): string =
|
||||
## Retrieves the ``i``'th command line parameter.
|
||||
builtin
|
||||
|
||||
proc paramCount*(): int =
|
||||
## Retrieves the number of command line parameters.
|
||||
builtin
|
||||
|
||||
proc switch*(key: string, val="") =
|
||||
## Sets a Nim compiler command line switch, for
|
||||
## example ``switch("checks", "on")``.
|
||||
|
||||
Reference in New Issue
Block a user