summaryrefslogtreecommitdiff
path: root/xsd/processing/inheritance
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-07-27 11:58:50 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-07-27 11:58:50 +0200
commit72c8c02e5c841da2ec07a74d0a385c89209937a4 (patch)
tree037e08c35e824209fa7bf721d76c7f65bbb788cd /xsd/processing/inheritance
parentaa6aee72b74f6d1f0eece7d2f57ca7d71173214e (diff)
Make sure we don't process sourced schemas more than once
Diffstat (limited to 'xsd/processing/inheritance')
-rw-r--r--xsd/processing/inheritance/processor.cxx19
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;