enable nimExperimentalLinenoiseExtra (#24227)

follow up https://github.com/nim-lang/Nim/pull/16977

it was added in 1.6.0

(cherry picked from commit a65501325c)
This commit is contained in:
ringabout
2024-10-06 19:33:40 +08:00
committed by narimiran
parent 6c96892d5e
commit e13f86a596
3 changed files with 3 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ proc printKeyCodes*() {.importc: "linenoisePrintKeyCodes".}
proc free*(s: cstring) {.importc: "free", header: "<stdlib.h>".}
when defined(nimExperimentalLinenoiseExtra) and not defined(windows):
when not defined(windows):
# C interface
type LinenoiseStatus = enum
linenoiseStatus_ctrl_unknown
@@ -58,7 +58,7 @@ when defined(nimExperimentalLinenoiseExtra) and not defined(windows):
## line editing API that allows returning the line entered and an indicator
## of which control key was entered, allowing user to distinguish between
## for example ctrl-C vs ctrl-D.
runnableExamples("-d:nimExperimentalLinenoiseExtra -r:off"):
runnableExamples("-r:off"):
var ret: ReadLineResult
while true:
readLineStatus("name: ", ret) # ctrl-D will exit, ctrl-C will go to next prompt

View File

@@ -30,9 +30,6 @@ hint("Processing", off)
# switch("hint", "ConvFromXtoItselfNotNeeded")
# switch("warningAsError", "InheritFromException") # would require fixing a few tests
# experimental APIs are enabled in testament, refs https://github.com/timotheecour/Nim/issues/575
# sync with `kochdocs.docDefines` or refactor.
switch("define", "nimExperimentalLinenoiseExtra")
# preview APIs are expected to be the new default in upcoming versions
#switch("define", "nimPreviewDotLikeOps") # deprecated?

View File

@@ -16,7 +16,7 @@ const
paCode* = " --doc.plausibleAnalytics:nim-lang.org"
# errormax: subsequent errors are probably consequences of 1st one; a simple
# bug could cause unlimited number of errors otherwise, hard to debug in CI.
docDefines = "-d:nimExperimentalLinenoiseExtra"
docDefines = "-d:nimExperimentalLinenoiseExtra" # deadcode `nimExperimentalLinenoiseExtra` has been enabled
nimArgs = "--errormax:3 --hint:Conf:off --hint:Path:off --hint:Processing:off --hint:XDeclaredButNotUsed:off --warning:UnusedImport:off -d:boot --putenv:nimversion=$# $#" % [system.NimVersion, docDefines]
gitUrl = "https://github.com/nim-lang/Nim"
docHtmlOutput = "doc/html"