From 284a8cb58ac8abee54d7ed2ba95c82ad9179004f Mon Sep 17 00:00:00 2001 From: Araq Date: Fri, 28 Jun 2019 11:45:21 +0200 Subject: nimpretty: bugfix [bugfix] --- nimpretty/tests/exhaustive.nim | 39 +++++++++++++++++++++++++++++++++ nimpretty/tests/expected/exhaustive.nim | 39 +++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) (limited to 'nimpretty') diff --git a/nimpretty/tests/exhaustive.nim b/nimpretty/tests/exhaustive.nim index 14c318495..ffdc95cca 100644 --- a/nimpretty/tests/exhaustive.nim +++ b/nimpretty/tests/exhaustive.nim @@ -618,3 +618,42 @@ veryLongVariableName.createVar("future" & $node[1][0].toStrLit, node[1], futureV veryLongVariableName.createVar("future" & $node[1][0].toStrLit, node[1], futureValue1, futureValue2, node) + +type + CmdLineKind* = enum ## The detected command line token. + cmdEnd, ## End of command line reached + cmdArgument, ## An argument such as a filename + cmdLongOption, ## A long option such as --option + cmdShortOption ## A short option such as -c + OptParser* = object of RootObj ## \ + ## Implementation of the command line parser. Here is even more text yad. + ## + ## To initialize it, use the + ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. + pos*: int + inShortState: bool + allowWhitespaceAfterColon: bool + shortNoVal: set[char] + longNoVal: seq[string] + cmds: seq[string] + idx: int + kind*: CmdLineKind ## The detected command line token + key*, val*: TaintedString ## Key and value pair; the key is the option + ## or the argument, and the value is not "" if + ## the option was given a value + + OptParserDifferently* = object of RootObj ## Implementation of the command line parser. + ## + ## To initialize it, use the + ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. + pos*: int + inShortState: bool + allowWhitespaceAfterColon: bool + shortNoVal: set[char] + longNoVal: seq[string] + cmds: seq[string] + idx: int + kind*: CmdLineKind ## The detected command line token + key*, val*: TaintedString ## Key and value pair; the key is the option + ## or the argument, and the value is not "" if + ## the option was given a value diff --git a/nimpretty/tests/expected/exhaustive.nim b/nimpretty/tests/expected/exhaustive.nim index 21ff505dd..4d0366afb 100644 --- a/nimpretty/tests/expected/exhaustive.nim +++ b/nimpretty/tests/expected/exhaustive.nim @@ -624,3 +624,42 @@ veryLongVariableName.createVar("future" & $node[1][0].toStrLit, node[1], veryLongVariableName.createVar("future" & $node[1][0].toStrLit, node[1], futureValue1, futureValue2, node) + +type + CmdLineKind* = enum ## The detected command line token. + cmdEnd, ## End of command line reached + cmdArgument, ## An argument such as a filename + cmdLongOption, ## A long option such as --option + cmdShortOption ## A short option such as -c + OptParser* = object of RootObj ## \ + ## Implementation of the command line parser. Here is even more text yad. + ## + ## To initialize it, use the + ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. + pos*: int + inShortState: bool + allowWhitespaceAfterColon: bool + shortNoVal: set[char] + longNoVal: seq[string] + cmds: seq[string] + idx: int + kind*: CmdLineKind ## The detected command line token + key*, val*: TaintedString ## Key and value pair; the key is the option + ## or the argument, and the value is not "" if + ## the option was given a value + + OptParserDifferently* = object of RootObj ## Implementation of the command line parser. + ## + ## To initialize it, use the + ## `initOptParser proc<#initOptParser,string,set[char],seq[string]>`_. + pos*: int + inShortState: bool + allowWhitespaceAfterColon: bool + shortNoVal: set[char] + longNoVal: seq[string] + cmds: seq[string] + idx: int + kind*: CmdLineKind ## The detected command line token + key*, val*: TaintedString ## Key and value pair; the key is the option + ## or the argument, and the value is not "" if + ## the option was given a value -- cgit 1.4.1-2-gfad0