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