From 566cec74b6a8d45ea20e71131b8e40792366d924 Mon Sep 17 00:00:00 2001 From: alaviss Date: Wed, 7 Mar 2018 20:46:02 +0700 Subject: [PATCH 1/6] lib/system: Fix programResult documentation (#7307) --- lib/system.nim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/system.nim b/lib/system.nim index 886ef3c37d..b71a3c73ca 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1461,9 +1461,9 @@ when defined(nodejs): programResult = 0 else: var programResult* {.exportc: "nim_program_result".}: int - ## modify this variable to specify the exit code of the program - ## under normal circumstances. When the program is terminated - ## prematurely using ``quit``, this value is ignored. + ## modify this variable to specify the exit code of the program + ## under normal circumstances. When the program is terminated + ## prematurely using ``quit``, this value is ignored. when defined(nimdoc): proc quit*(errorcode: int = QuitSuccess) {.magic: "Exit", noreturn.} From 551d7b7dc17d0eb05cbc8fd935c584739ce66bb2 Mon Sep 17 00:00:00 2001 From: c-blake Date: Thu, 8 Mar 2018 02:12:34 -0500 Subject: [PATCH 2/6] Add ability for users to elide ':' or '=' when CLI authors pass a (#7297) * Add ability for users to elide ':' or '=' when CLI authors pass a non-empty partial symbol table. Behavior should be identical to the old behavior if empty partial symbol tables are passed. "Partialness" of the symbol table refers to the fact that one need only specify option keys that are toggles/booleans/do not take arguments, hence the "NoArg" suffixes in shortNoArg and longNoArg. commandLineParams() returns seq[TaintedString], so use that consistently in getopt() and initOptParser(seq[TaintedString]) dropping the taint at the quoting stage just as with the paramStr() logic. Fix capitalization inconsistency of cmdLongOption. Export OptParser.cmd and OptParser.pos so that, at least *in principle*, users of this API can handle "--" option processing termination or some "git-like" sub-command stop word with a separate option sub-syntax. { Eg., ``case p.key of "": echo "trailing non-option args: ", p.cmd[p.pos..^1]`` or ``case p.kind of cmdArgument: if p.key == "mysubcmd": ...``. } Really, searching for the last delimiter before p.pos is probably needed to frame the trailing text..Not the nicest API, but still possible with effort. * Make requested changes from string to seq[char] (see https://github.com/nim-lang/Nim/pull/7297) * Document new behavior and elaborate on some special cases. * NoArg => NoVal to be less ambiguous/more clear. * Add more documentation and an example snippet. * Tweak language. Clarify still using ':'/'=' is ok. * Add a test case for new NoVal behavior. --- lib/pure/parseopt.nim | 85 +++++++++++++++++++++++++++++----------- tests/misc/tparseopt.nim | 20 ++++++++++ 2 files changed, 83 insertions(+), 22 deletions(-) diff --git a/lib/pure/parseopt.nim b/lib/pure/parseopt.nim index cf275a88a3..ffb69a72b5 100644 --- a/lib/pure/parseopt.nim +++ b/lib/pure/parseopt.nim @@ -11,11 +11,23 @@ ## It supports one convenience iterator over all command line options and some ## lower-level features. ## -## Supported syntax: +## Supported syntax with default empty ``shortNoVal``/``longNoVal``: ## ## 1. short options - ``-abcd``, where a, b, c, d are names ## 2. long option - ``--foo:bar``, ``--foo=bar`` or ``--foo`` ## 3. argument - everything else +## +## When ``shortNoVal``/``longNoVal`` are non-empty then the ':' and '=' above +## are still accepted, but become optional. Note that these option key sets +## must be updated along with the set of option keys taking no value, but +## keys which do take values need no special updates as their set evolves. +## +## When option values begin with ':' or '=' they need to be doubled up (as in +## ``--delim::``) or alternated (as in ``--delim=:``). +## +## The common ``--`` non-option argument delimiter appears as an empty string +## long option key. ``OptParser.cmd``, ``OptParser.pos``, and +## ``os.parseCmdLine`` may be used to complete parsing in that case. {.push debugger: off.} @@ -32,9 +44,11 @@ type cmdShortOption ## a short option ``-c`` detected OptParser* = object of RootObj ## this object implements the command line parser - cmd: string - pos: int + cmd*: string # cmd,pos exported so caller can catch "--" as.. + pos*: int # ..empty key or subcmd cmdArg & handle specially inShortState: bool + shortNoVal: set[char] + longNoVal: seq[string] kind*: CmdLineKind ## the dected command line token key*, val*: TaintedString ## key and value pair; ``key`` is the option ## or the argument, ``value`` is not "" if @@ -78,11 +92,19 @@ when declared(os.paramCount): # we cannot provide this for NimRtl creation on Posix, because we can't # access the command line arguments then! - proc initOptParser*(cmdline = ""): OptParser = + proc initOptParser*(cmdline = "", shortNoVal: set[char]={}, + longNoVal: seq[string] = @[]): OptParser = ## inits the option parser. If ``cmdline == ""``, the real command line - ## (as provided by the ``OS`` module) is taken. + ## (as provided by the ``OS`` module) is taken. If ``shortNoVal`` is + ## provided command users do not need to delimit short option keys and + ## values with a ':' or '='. If ``longNoVal`` is provided command users do + ## not need to delimit long option keys and values with a ':' or '=' + ## (though they still need at least a space). In both cases, ':' or '=' + ## may still be used if desired. They just become optional. result.pos = 0 result.inShortState = false + result.shortNoVal = shortNoVal + result.longNoVal = longNoVal if cmdline != "": result.cmd = cmdline else: @@ -94,15 +116,19 @@ when declared(os.paramCount): result.key = TaintedString"" result.val = TaintedString"" - proc initOptParser*(cmdline: seq[string]): OptParser = + proc initOptParser*(cmdline: seq[TaintedString], shortNoVal: set[char]={}, + longNoVal: seq[string] = @[]): OptParser = ## inits the option parser. If ``cmdline.len == 0``, the real command line - ## (as provided by the ``OS`` module) is taken. + ## (as provided by the ``OS`` module) is taken. ``shortNoVal`` and + ## ``longNoVal`` behavior is the same as for ``initOptParser(string,...)``. result.pos = 0 result.inShortState = false + result.shortNoVal = shortNoVal + result.longNoVal = longNoVal result.cmd = "" if cmdline.len != 0: for i in 0.. Date: Thu, 8 Mar 2018 15:33:41 +0800 Subject: [PATCH 3/6] FIXUP: Removed +1 causing substr slicing to skip chars on first iteration of while loop (#7312) --- lib/pure/strutils.nim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pure/strutils.nim b/lib/pure/strutils.nim index 0c35c1d52f..ddd0e9e620 100644 --- a/lib/pure/strutils.nim +++ b/lib/pure/strutils.nim @@ -1250,7 +1250,7 @@ proc wordWrap*(s: string, maxLineWidth = 80, if len(word) > spaceLeft: if splitLongWords and len(word) > maxLineWidth: result.add(substr(word, 0, spaceLeft-1)) - var w = spaceLeft+1 + var w = spaceLeft var wordLeft = len(word) - spaceLeft while wordLeft > 0: result.add(newLine) @@ -2514,6 +2514,11 @@ when isMainModule: outp = " this is a\nlong text\n--\nmuchlongerthan10chars\nand here\nit goes" doAssert wordWrap(inp, 10, false) == outp + let + longInp = """ThisIsOneVeryLongStringWhichWeWillSplitIntoEightSeparatePartsNow""" + longOutp = "ThisIsOn\neVeryLon\ngStringW\nhichWeWi\nllSplitI\nntoEight\nSeparate\nPartsNow" + doAssert wordWrap(longInp, 8, true) == longOutp + doAssert formatBiggestFloat(1234.567, ffDecimal, -1) == "1234.567000" doAssert formatBiggestFloat(1234.567, ffDecimal, 0) == "1235." doAssert formatBiggestFloat(1234.567, ffDecimal, 1) == "1234.6" From 63c28b973e84e86ad0b9a69cf683cf93809af4f2 Mon Sep 17 00:00:00 2001 From: cooldome Date: Thu, 8 Mar 2018 09:56:32 +0000 Subject: [PATCH 4/6] Allow only single infix as in except branches. Fixes #7115 (#7132) --- compiler/semstmts.nim | 74 +++++++++++++++++--------------------- tests/exception/texcas.nim | 8 +++++ 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 1e3265eae6..ce553cabf4 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -255,69 +255,61 @@ proc semCase(c: PContext, n: PNode): PNode = result.typ = typ proc semTry(c: PContext, n: PNode): PNode = + + var check = initIntSet() + template semExceptBranchType(typeNode: PNode): PNode = + let typ = semTypeNode(c, typeNode, nil).toObject() + if typ.kind != tyObject: + localError(typeNode.info, errExprCannotBeRaised) + if containsOrIncl(check, typ.id): + localError(typeNode.info, errExceptionAlreadyHandled) + newNodeIT(nkType, typeNode.info, typ) + result = n inc c.p.inTryStmt checkMinSonsLen(n, 2) var typ = commonTypeBegin - n.sons[0] = semExprBranchScope(c, n.sons[0]) - typ = commonType(typ, n.sons[0].typ) + n[0] = semExprBranchScope(c, n[0]) + typ = commonType(typ, n[0].typ) - var check = initIntSet() var last = sonsLen(n) - 1 for i in countup(1, last): - var a = n.sons[i] + let a = n.sons[i] checkMinSonsLen(a, 1) - var length = sonsLen(a) openScope(c) if a.kind == nkExceptBranch: - # so that ``except [a, b, c]`` is supported: - if length == 2 and a.sons[0].kind == nkBracket: - a.sons[0..0] = a.sons[0].sons - length = a.sonsLen - # Iterate through each exception type in the except branch. - for j in countup(0, length-2): - var typeNode = a.sons[j] # e.g. `Exception` - var symbolNode: PNode = nil # e.g. `foobar` - # Handle the case where the `Exception as foobar` syntax is used. - if typeNode.isInfixAs(): - typeNode = a.sons[j].sons[1] - symbolNode = a.sons[j].sons[2] + if a.len == 2 and a[0].kind == nkBracket: + # rewrite ``except [a, b, c]: body`` -> ```except a, b, c: body``` + a.sons[0..0] = a[0].sons + + if a.len == 2 and a[0].isInfixAs(): + # support ``except Exception as ex: body`` + a[0][1] = semExceptBranchType(a[0][1]) - # Resolve the type ident into a PType. - var typ = semTypeNode(c, typeNode, nil).toObject() - if typ.kind != tyObject: - localError(a.sons[j].info, errExprCannotBeRaised) + let symbol = newSymG(skLet, a[0][2], c) + symbol.typ = a[0][1].typ.toRef() + addDecl(c, symbol) + # Overwrite symbol in AST with the symbol in the symbol table. + a[0][2] = newSymNode(symbol, a[0][2].info) - let newTypeNode = newNodeI(nkType, typeNode.info) - newTypeNode.typ = typ - if symbolNode.isNil: - a.sons[j] = newTypeNode - else: - a.sons[j].sons[1] = newTypeNode - # Add the exception ident to the symbol table. - let symbol = newSymG(skLet, symbolNode, c) - symbol.typ = typ.toRef() - addDecl(c, symbol) - # Overwrite symbol in AST with the symbol in the symbol table. - let symNode = newNodeI(nkSym, typeNode.info) - symNode.sym = symbol - a.sons[j].sons[2] = symNode - - if containsOrIncl(check, typ.id): - localError(a.sons[j].info, errExceptionAlreadyHandled) + else: + # support ``except KeyError, ValueError, ... : body`` + for j in 0..a.len-2: + a[j] = semExceptBranchType(a[j]) + elif a.kind != nkFinally: illFormedAst(n) # last child of an nkExcept/nkFinally branch is a statement: - a.sons[length-1] = semExprBranchScope(c, a.sons[length-1]) - if a.kind != nkFinally: typ = commonType(typ, a.sons[length-1].typ) + a[^1] = semExprBranchScope(c, a[^1]) + if a.kind != nkFinally: typ = commonType(typ, a[^1]) else: dec last closeScope(c) dec c.p.inTryStmt - if isEmptyType(typ) or typ.kind == tyNil: + if isEmptyType(typ) or typ.kind in {tyNil, tyExpr}: discardCheck(c, n.sons[0]) for i in 1..n.len-1: discardCheck(c, n.sons[i].lastSon) if typ == enforceVoidContext: diff --git a/tests/exception/texcas.nim b/tests/exception/texcas.nim index 298aee707c..7108e334c5 100644 --- a/tests/exception/texcas.nim +++ b/tests/exception/texcas.nim @@ -32,3 +32,11 @@ proc testTryAsExpr(i: int) = test[Exception]() test2() testTryAsExpr(5) + +# see bug #7115 +doAssert(not compiles( + try: + echo 1 + except [KeyError as ex1, ValueError as ex2]: + echo 2 +)) From cbd059aa85c81fefb40159773182fafaf2de9617 Mon Sep 17 00:00:00 2001 From: zah Date: Thu, 8 Mar 2018 16:10:45 +0200 Subject: [PATCH 5/6] Fix #6415 (#7281) * hangle static generic params when used in the importcpp pragma * importcpp works for generic types with fields; fixes #6415 * revert a too agressive safety check that ended up breaking the tests --- changelog.md | 5 +++ compiler/ccgtypes.nim | 9 ++++- compiler/semtypes.nim | 10 +++-- tests/statictypes/tstaticimportcpp.nim | 53 ++++++++++++++++++++++++++ 4 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 tests/statictypes/tstaticimportcpp.nim diff --git a/changelog.md b/changelog.md index 00c638f1d3..46428f9ab4 100644 --- a/changelog.md +++ b/changelog.md @@ -25,3 +25,8 @@ ### Compiler changes ### Bugfixes + +- The `importcpp` pragma now allows importing the listed fields of generic + C++ types. Support for numeric parameters have also been added through + the use of `static[T]` types. + (#6415) diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 6f9da56e34..bdba34e361 100644 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -617,8 +617,10 @@ proc scanCppGenericSlot(pat: string, cursor, outIdx, outStars: var int): bool = return false proc resolveStarsInCppType(typ: PType, idx, stars: int): PType = - # XXX: we should catch this earlier and report it as a semantic error - if idx >= typ.len: internalError "invalid apostrophe type parameter index" + # Make sure the index refers to one of the generic params of the type. + # XXX: we should catch this earlier and report it as a semantic error. + if idx >= typ.len: + internalError "invalid apostrophe type parameter index" result = typ.sons[idx] for i in 1..stars: @@ -820,6 +822,9 @@ proc getTypeDescAux(m: BModule, origTyp: PType, check: var IntSet): Rope = let typeInSlot = resolveStarsInCppType(origTyp, idx + 1, stars) if typeInSlot == nil or typeInSlot.kind == tyVoid: result.add(~"void") + elif typeInSlot.kind == tyStatic: + internalAssert typeInSlot.n != nil + result.add typeInSlot.n.renderTree else: result.add getTypeDescAux(m, typeInSlot, check) else: diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index 50c2e287e2..e9f4e1a989 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -632,16 +632,18 @@ proc semRecordNodeAux(c: PContext, n: PNode, check: var IntSet, pos: var int, else: typ = semTypeNode(c, n.sons[length-2], nil) propagateToOwner(rectype, typ) - let rec = rectype.sym + var fieldOwner = if c.inGenericContext > 0: c.getCurrOwner + else: rectype.sym for i in countup(0, sonsLen(n)-3): var f = semIdentWithPragma(c, skField, n.sons[i], {sfExported}) suggestSym(n.sons[i].info, f, c.graph.usageSym) f.typ = typ f.position = pos - if (rec != nil) and ({sfImportc, sfExportc} * rec.flags != {}) and - (f.loc.r == nil): + if fieldOwner != nil and + {sfImportc, sfExportc} * fieldOwner.flags != {} and + f.loc.r == nil: f.loc.r = rope(f.name.s) - f.flags = f.flags + ({sfImportc, sfExportc} * rec.flags) + f.flags = f.flags + ({sfImportc, sfExportc} * fieldOwner.flags) inc(pos) if containsOrIncl(check, f.name.id): localError(n.sons[i].info, errAttemptToRedefine, f.name.s) diff --git a/tests/statictypes/tstaticimportcpp.nim b/tests/statictypes/tstaticimportcpp.nim new file mode 100644 index 0000000000..e13cc36b45 --- /dev/null +++ b/tests/statictypes/tstaticimportcpp.nim @@ -0,0 +1,53 @@ +discard """ +targets: "cpp" +output: "[0, 0, 10, 0]\n5\n1.2\n15\ntest" +""" + +{.emit: """ + +template +struct GenericIntType { + T data[N]; +}; + +template +struct GenericTType { + T field; +}; + +struct SimpleStruct { + int field; +}; + + +""" .} + +type + GenericIntType {.importcpp: "GenericIntType<'0, '1>".} [N: static[int]; T] = object + data: array[N, T] + + GenericTType {.importcpp: "GenericTType<'0>".} [T] = object + field: T + + GenInt4 = GenericIntType[4, int] + + SimpleStruct {.importcpp: "SimpleStruct"} = object + field: int + +var + a = GenInt4() + b = SimpleStruct() + c = GenericTType[float]() + d = SimpleStruct(field: 15) + e = GenericTType[string](field: "test") + +a.data[2] = 10 +b.field = 5 +c.field = 1.2 + +echo a.data +echo b.field +echo c.field +echo d.field +echo e.field + From 5003942256ad1e108f7ea1a93b89b54b5ec087ba Mon Sep 17 00:00:00 2001 From: PMunch Date: Thu, 8 Mar 2018 15:11:45 +0100 Subject: [PATCH 6/6] Renamed jsondoc2 to jsondoc, similar to doc2 (#7279) * Update information about jsondoc/jsondoc2 Manual was missing information about jsondoc2 which made it seem like it didn't exist at all. This commit adds mention of the jsondoc2 command along with an example. * Renamed jsondoc2 similar to doc2 and updated docs doc2 was recently renamed to doc while doc was renamed to doc0. This commits renames jsondoc to jsondoc2 and jsondoc2 to jsondoc0 to behave tha same way. The documentation for doc/jsondoc was also lagging behind this change which has also been fixed. I interpreted this as a soft deprecation of doc and jsondoc and therefore removed them from the auto-complete lists. --- changelog.md | 3 ++ compiler/main.nim | 4 +-- doc/advopt.txt | 1 - doc/docgen.rst | 73 +++++++++++++++++++++++++-------------- tools/nim.bash-completion | 2 +- tools/nim.zsh-completion | 2 -- 6 files changed, 54 insertions(+), 31 deletions(-) diff --git a/changelog.md b/changelog.md index 46428f9ab4..6844d37918 100644 --- a/changelog.md +++ b/changelog.md @@ -22,6 +22,9 @@ ### Tool changes +- ``jsondoc2`` has been renamed ``jsondoc``, similar to how ``doc2`` was renamed + ``doc``. The old ``jsondoc`` can still be invoked with ``jsondoc0``. + ### Compiler changes ### Bugfixes diff --git a/compiler/main.nim b/compiler/main.nim index 4a8fdf9988..20a7158864 100644 --- a/compiler/main.nim +++ b/compiler/main.nim @@ -210,14 +210,14 @@ proc mainCommand*(graph: ModuleGraph; cache: IdentCache) = gCmd = cmdRst2tex loadConfigs(DocTexConfig, cache) commandRst2TeX() - of "jsondoc": + of "jsondoc0": wantMainModule() gCmd = cmdDoc loadConfigs(DocConfig, cache) wantMainModule() defineSymbol("nimdoc") commandJson() - of "jsondoc2": + of "jsondoc2", "jsondoc": gCmd = cmdDoc loadConfigs(DocConfig, cache) wantMainModule() diff --git a/doc/advopt.txt b/doc/advopt.txt index c8ff0845ad..77531f5def 100644 --- a/doc/advopt.txt +++ b/doc/advopt.txt @@ -7,7 +7,6 @@ Advanced commands: //rst2html convert a reStructuredText file to HTML //rst2tex convert a reStructuredText file to TeX //jsondoc extract the documentation to a json file - //jsondoc2 extract the documentation to a json file (uses doc2) //ctags create a tags file //buildIndex build an index for the whole documentation //run run the project (with Tiny C backend; buggy!) diff --git a/doc/docgen.rst b/doc/docgen.rst index 40c464ebdd..e6693e1537 100644 --- a/doc/docgen.rst +++ b/doc/docgen.rst @@ -84,51 +84,72 @@ Document Types HTML ---- -Generation of HTML documents is done via both the ``doc`` and ``doc2`` -commands. These command take either a single .nim file, outputting a single -.html file with the same base filename, or multiple .nim files, outputting -multiple .html files and, optionally, an index file. +Generation of HTML documents is done via the ``doc`` command. This command +takes either a single .nim file, outputting a single .html file with the same +base filename, or multiple .nim files, outputting multiple .html files and, +optionally, an index file. The ``doc`` command:: nim doc sample -Partial Output:: - ... - proc helloWorld*(times: int) - ... - -Output can be viewed in full here: `docgen_sample.html `_. -The next command, called ``doc2``, is very similar to the ``doc`` command, but -will be run after the compiler performs semantic checking on the input nim -module(s), which allows it to process macros. - -The ``doc2`` command:: - nim doc2 sample - Partial Output:: ... proc helloWorld(times: int) {.raises: [], tags: [].} ... The full output can be seen here: `docgen_sample2.html `_. -As you can see, the tool has extracted additional information provided to it by -the compiler beyond what the ``doc`` command provides, such as pragmas attached -implicitly by the compiler. This type of information is not available from -looking at the AST (Abstract Syntax Tree) prior to semantic checking, as the -``doc`` command does. + +The older version of the ``doc`` command, now renamed ``doc0`` runs before +semantic checking which means it lacks some of the things ``doc`` will output. + +The ``doc0`` command:: + nim doc0 sample + +Partial Output:: + ... + proc helloWorld*(times: int) + ... + +Output can be viewed in full here: `docgen_sample.html `_. +As you can see, the tool has extracted less information than what the ``doc`` +command provides, such as pragmas attached implicitly by the compiler. This type +of information is not available from looking at the AST (Abstract Syntax Tree) +prior to semantic checking, which is why ``doc0`` doesn't show it. JSON ---- Generation of JSON documents is done via the ``jsondoc`` command. This command -takes in a .nim file, and outputs a .json file with the same base filename. -Note that this tool is built off of the ``doc`` command, and therefore is -performed before semantic checking. +takes in a .nim file, and outputs a .json file with the same base filename. Note +that this tool is built off of the ``doc`` command (previously ``doc2``), and +contains the same information. The ``jsondoc`` command:: nim jsondoc sample +Output:: + { + "orig": "docgen_sample.nim", + "nimble": "", + "entries": [ + { + "name": "helloWorld", + "type": "skProc", + "line": 5, + "col": 0, + "description": "Takes an integer and outputs as many "hello world!"s", + "code": "proc helloWorld(times: int) {.raises: [], tags: [].}" + } + ] + } + +Similarly to the old ``doc`` command the old ``jsondoc`` command has been +renamed ``jsondoc0``. + +The ``jsondoc0`` command:: + nim jsondoc0 sample + Output:: [ { @@ -142,6 +163,8 @@ Output:: } ] +Note that the ``jsondoc`` command outputs it's JSON without pretty-printing it, +while ``jsondoc0`` outputs pretty-printed JSON. Related Options =============== diff --git a/tools/nim.bash-completion b/tools/nim.bash-completion index 4f62da986e..1c199a0cfa 100644 --- a/tools/nim.bash-completion +++ b/tools/nim.bash-completion @@ -10,7 +10,7 @@ _nim() if [ $COMP_CWORD -eq 1 ] ; then # first item - suggest commands - kw="compile c doc doc2 compileToC cc compileToCpp cpp compileToOC objc js e rst2html rst2tex jsondoc jsondoc2 buildIndex genDepend dump check" + kw="compile c doc compileToC cc compileToCpp cpp compileToOC objc js e rst2html rst2tex jsondoc buildIndex genDepend dump check" COMPREPLY=( $( compgen -W "${kw}" -- $cur ) ) return 0 fi diff --git a/tools/nim.zsh-completion b/tools/nim.zsh-completion index 135649c90d..57b5e163ec 100644 --- a/tools/nim.zsh-completion +++ b/tools/nim.zsh-completion @@ -5,7 +5,6 @@ _nim() { ':command:(( {compile,c}\:compile\ project\ with\ default\ code\ generator\ C doc\:generate\ the\ documentation\ for\ inputfile - doc2\:generate\ the\ documentation\ for\ inputfile {compileToC,cc}\:compile\ project\ with\ C\ code\ generator {compileToCpp,cpp}\:compile\ project\ to\ C++\ code {compileToOC,objc}\:compile\ project\ to\ Objective\ C\ code @@ -14,7 +13,6 @@ _nim() { rst2html\:convert\ a\ reStructuredText\ file\ to\ HTML rst2tex\:convert\ a\ reStructuredText\ file\ to\ TeX jsondoc\:extract\ the\ documentation\ to\ a\ json\ file - jsondoc2\:extract\ documentation\ to\ a\ json\ file\ using\ doc2 buildIndex\:build\ an\ index\ for\ the\ whole\ documentation genDepend\:generate\ a\ DOT\ file\ containing\ the\ module\ dependency\ graph dump\:dump\ all\ defined\ conditionals\ and\ search\ paths