Fix symbol printing in schemas
This commit is contained in:
parent
df53ff0d41
commit
a7acd971d2
|
@ -461,7 +461,7 @@ proc generateNimFile*(scm: Schema; path: string) =
|
|||
nn(nkPragma,
|
||||
nn(nkExprColonExpr,
|
||||
ident"record",
|
||||
PNode(kind: nkStrLit, strVal: $def.nodes[0])))),
|
||||
PNode(kind: nkStrLit, strVal: $def.nodes[0].value.symbol)))),
|
||||
newEmpty(),
|
||||
t)
|
||||
else:
|
||||
|
|
|
@ -137,7 +137,13 @@ proc `$`*(n: SchemaNode): string =
|
|||
result.add " ...:...}"
|
||||
of snkRecord:
|
||||
result.add '<'
|
||||
result.add join(n.nodes, " ")
|
||||
if n.nodes[0].kind == snkLiteral and n.nodes[0].value.kind == pkSymbol:
|
||||
result.add n.nodes[0].value.symbol
|
||||
for i in 1..n.nodes.high:
|
||||
result.add ' '
|
||||
result.add $n.nodes[i]
|
||||
else:
|
||||
result.add join(n.nodes, " ")
|
||||
result.add '>'
|
||||
of snkTuple:
|
||||
result.add '['
|
||||
|
|
Loading…
Reference in New Issue