diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-04-15 13:25:40 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-04-15 22:16:07 +0200 |
commit | ed9c28484a709aa017e20b60297a6f6e126537bc (patch) | |
tree | c03f5492362c6e6c160c4667787ac793ae5a033b /lib/packages | |
parent | efae3668570b51fa14483663d1979a6a8a6852fe (diff) | |
download | Nim-ed9c28484a709aa017e20b60297a6f6e126537bc.tar.gz |
docutils: make ':test:' work without argument
Diffstat (limited to 'lib/packages')
-rw-r--r-- | lib/packages/docutils/rstgen.nim | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/packages/docutils/rstgen.nim b/lib/packages/docutils/rstgen.nim index e6c95b59e..ee1f0076c 100644 --- a/lib/packages/docutils/rstgen.nim +++ b/lib/packages/docutils/rstgen.nim @@ -820,7 +820,7 @@ proc parseCodeBlockField(d: PDoc, n: PRstNode, params: var CodeBlockParams) = ## ## This supports the special ``default-language`` internal string generated ## by the ``rst`` module to communicate a specific default language. - case n.getArgument.toLower + case n.getArgument.toLowerAscii of "number-lines": params.numberLines = true # See if the field has a parameter specifying a different line than 1. @@ -836,8 +836,11 @@ proc parseCodeBlockField(d: PDoc, n: PRstNode, params: var CodeBlockParams) = params.filename = n.getFieldValue.strip of "test": params.testCmd = n.getFieldValue.strip - if params.testCmd.len == 0: params.testCmd = "nim c -r $1" - of "status": + if params.testCmd.len == 0: + params.testCmd = "nim c -r $1" + else: + params.testCmd = unescape(params.testCmd) + of "status", "exitcode": var status: int if parseInt(n.getFieldValue, status) > 0: params.status = status |