diff --git a/cligen/tern.nim b/cligen/tern.nim index 9575f3ee..83005123 100644 --- a/cligen/tern.nim +++ b/cligen/tern.nim @@ -7,18 +7,17 @@ ##``CritBitTree`` (except a ``longestMatch`` -> ``longest`` parameter rename ##which will be trapped by the compiler if you use kwargs). ``CritBitTree`` ##itself is API-compatible with the union of both ``HashSet`` and ``Table``. -#{.warning[Uninit]:off, warning[ProveInit]:off.} # Should be verbosity:2 not 1 +{.warning[Uninit]:off, warning[ProveInit]:off.} # Should be verbosity:2 not 1 import std/algorithm, ./sysUt # reverse, postInc const NUL* = '\0' type - NodeOb*[T] {.acyclic.} = object + Node[T] {.acyclic.} = ref object ch*: char cnt*: int when T isnot void: val*: T - kid*: array[3, ref NodeOb[T]] #0,1,2 ~ <,=,> - Node*[T] = ref NodeOb[T] + kid*: array[3, Node[T]] #0,1,2 ~ <,=,> Tern*[T] = object ## A Tern can be used as either a mapping from strings ## to type ``T`` or as a set(strings) if ``T`` is void. root*: Node[T] diff --git a/cligen/trie.nim b/cligen/trie.nim index 362697eb..decfb266 100644 --- a/cligen/trie.nim +++ b/cligen/trie.nim @@ -2,17 +2,16 @@ ##digital search tree family. It is drop-in compatible-ish with ``CritBitTree`` ##itself compatible with both ``HashSet[string]`` & ``Table[string,*]``. It was ##easier for me to extend this with ``match``&``nearLev`` than ``CritBitTree``. -#{.warning[Uninit]:off, warning[ProveInit]:off.} # Should be verbosity:2 not 1 +{.warning[Uninit]:off, warning[ProveInit]:off.} # Should be verbosity:2 not 1 import ./sysUt, std/[sets, algorithm, strutils] # findUO|findO, HashSet, reverse type - NodeOb[T] {.acyclic.} = object + Node[T] {.acyclic.} = ref object term*: bool cnt*: uint32 when T isnot void: val*: T kidc*: string - kidp*: seq[ref NodeOb[T]] - Node*[T] = ref NodeOb[T] + kidp*: seq[Node[T]] Trie*[T] = object root*: Node[T] depth*: int # Depth of Tree