Nim/tests/vm/tyaytypedesc.nim
ringabout 3dbf2ac946
remove echo statements in tests (part 1) (#20178)
* remove echo statements

* Update tests/vm/triangle_array.nim

* Update tests/vm/tyaytypedesc.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-08-23 19:28:51 +02:00

17 lines
402 B
Nim

# bug #3357
type NodeType* = enum
ntWhitespace
type TokenType* = enum
ttWhitespace
proc enumTable*[A, B, C](a: openArray[tuple[key: A, val: B]], ret: typedesc[C]): C =
for item in a:
result[item.key] = item.val
const tokenTypeToNodeType = {
ttWhitespace: ntWhitespace,
}.enumTable(array[ttWhitespace..ttWhitespace, NodeType])
doAssert tokenTypeToNodeType[ttWhitespace] == ntWhitespace