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) =
|
||||
case sn.kind
|
||||
of snkLiteral:
|
||||
if sn.value.isDictionary:
|
||||
imports.add ident"std/tables"
|
||||
of snkDictOf:
|
||||
imports.add ident"std/tables"
|
||||
of snkRef:
|
||||
if sn.refPath.len > 1:
|
||||
imports.add ident(sn.refPath[0].toLowerAscii)
|
||||
|
|
Loading…
Reference in New Issue