Import tables when necessary
This commit is contained in:
parent
d43f9ca926
commit
de50a0a41d
|
@ -378,6 +378,11 @@ proc generateProcs(result: var seq[PNode]; name: string; sn: SchemaNode) =
|
||||||
|
|
||||||
proc collectRefImports(imports: PNode; sn: SchemaNode) =
|
proc collectRefImports(imports: PNode; sn: SchemaNode) =
|
||||||
case sn.kind
|
case sn.kind
|
||||||
|
of snkLiteral:
|
||||||
|
if sn.value.isDictionary:
|
||||||
|
imports.add ident"std/tables"
|
||||||
|
of snkDictOf:
|
||||||
|
imports.add ident"std/tables"
|
||||||
of snkRef:
|
of snkRef:
|
||||||
if sn.refPath.len > 1:
|
if sn.refPath.len > 1:
|
||||||
imports.add ident(sn.refPath[0].toLowerAscii)
|
imports.add ident(sn.refPath[0].toLowerAscii)
|
||||||
|
|
Loading…
Reference in New Issue