preserves_schema_nim: collect imports of simple compounds
This commit is contained in:
parent
9134fecb36
commit
2825bceecf
|
@ -1,6 +1,6 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "20240206"
|
version = "20240208"
|
||||||
author = "Emery Hemingway"
|
author = "Emery Hemingway"
|
||||||
description = "data model and serialization format"
|
description = "data model and serialization format"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
|
|
|
@ -930,10 +930,15 @@ proc collectRefImports(imports: var StringSet; loc: Location; pat: Pattern)
|
||||||
|
|
||||||
proc collectRefImports(imports: var StringSet; loc: Location; sp: SimplePattern) =
|
proc collectRefImports(imports: var StringSet; loc: Location; sp: SimplePattern) =
|
||||||
case sp.orKind
|
case sp.orKind
|
||||||
|
of SimplePatternKind.seqof:
|
||||||
|
collectRefImports(imports, loc, sp.seqof.pattern)
|
||||||
of SimplePatternKind.setof:
|
of SimplePatternKind.setof:
|
||||||
incl(imports, "std/sets")
|
incl(imports, "std/sets")
|
||||||
|
collectRefImports(imports, loc, sp.setof.pattern)
|
||||||
of SimplePatternKind.dictof:
|
of SimplePatternKind.dictof:
|
||||||
incl(imports, "std/tables")
|
incl(imports, "std/tables")
|
||||||
|
collectRefImports(imports, loc, sp.dictof.key)
|
||||||
|
collectRefImports(imports, loc, sp.dictof.value)
|
||||||
of SimplePatternKind.Ref:
|
of SimplePatternKind.Ref:
|
||||||
if sp.ref.module != @[] and sp.ref.module != loc.schemaPath:
|
if sp.ref.module != @[] and sp.ref.module != loc.schemaPath:
|
||||||
incl(imports, string sp.ref.module[0])
|
incl(imports, string sp.ref.module[0])
|
||||||
|
|
Loading…
Reference in New Issue