diff options
author | Neelesh Chandola <neelesh.chandola@outlook.com> | 2020-04-27 22:46:40 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-27 19:16:40 +0200 |
commit | d38853c504d89d6e361f064a17391afaf42d74b8 (patch) | |
tree | bb36866341c08608be8408a61ebd832dad2afaa5 /lib | |
parent | a3a317b76d7b189c9b28adc32ec02ab742610ae1 (diff) | |
download | Nim-d38853c504d89d6e361f064a17391afaf42d74b8.tar.gz |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/os.nim | 18 | ||||
-rw-r--r-- | lib/system/nimscript.nim | 8 |
2 files changed, 17 insertions, 9 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 2c3e91be8..d6f6aca5f 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -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") diff --git a/lib/system/nimscript.nim b/lib/system/nimscript.nim index f2a843652..e0c400f05 100644 --- a/lib/system/nimscript.nim +++ b/lib/system/nimscript.nim @@ -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")``. |