diff options
Diffstat (limited to 'xsd/processing/inheritance/processor.cxx')
-rw-r--r-- | xsd/processing/inheritance/processor.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/xsd/processing/inheritance/processor.cxx b/xsd/processing/inheritance/processor.cxx index 91ab627..318e3e4 100644 --- a/xsd/processing/inheritance/processor.cxx +++ b/xsd/processing/inheritance/processor.cxx @@ -391,6 +391,21 @@ namespace Processing }; + // Sources traverser that goes into each schema only once. + // + struct Sources: Traversal::Sources + { + virtual void + traverse (SemanticGraph::Sources& s) + { + if (schemas_.insert (&s.schema ()).second) + Traversal::Sources::traverse (s); + } + + private: + Cult::Containers::Set<SemanticGraph::Schema*> schemas_; + }; + // Go into included/imported schemas while making sure we don't // process the same stuff more than once. // @@ -420,7 +435,7 @@ namespace Processing if (!s.context ().count ("processing-inheritance-seen")) { Traversal::Schema schema; - Traversal::Sources sources; + Sources sources; schema >> sources >> schema; schema >> *this; @@ -456,7 +471,7 @@ namespace Processing // rely on the order of types in the schema. // Traversal::Schema schema; - Traversal::Sources sources; + Sources sources; Uses uses (tu, failed); schema >> sources >> schema; |