aboutsummaryrefslogtreecommitdiff
path: root/xsde/processing
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-07-27 12:00:39 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-07-27 12:00:39 +0200
commit62cadf03af778b508bd684be19c6e6958b2fe52f (patch)
tree28564b6906ae65a26b810444d989b002939b9b0b /xsde/processing
parentb8cd7bef48b9208223d061b4302c25dd3b09d413 (diff)
Make sure we don't process sourced schemas more than once
Diffstat (limited to 'xsde/processing')
-rw-r--r--xsde/processing/inheritance/processor.cxx19
1 files changed, 17 insertions, 2 deletions
diff --git a/xsde/processing/inheritance/processor.cxx b/xsde/processing/inheritance/processor.cxx
index 5900239..79615c3 100644
--- a/xsde/processing/inheritance/processor.cxx
+++ b/xsde/processing/inheritance/processor.cxx
@@ -422,6 +422,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.
//
@@ -453,7 +468,7 @@ namespace Processing
if (!s.context ().count ("processing-inheritance-seen"))
{
Traversal::Schema schema;
- Traversal::Sources sources;
+ Sources sources;
schema >> sources >> schema;
schema >> *this;
@@ -492,7 +507,7 @@ namespace Processing
// rely on the order of types in the schema.
//
Traversal::Schema schema;
- Traversal::Sources sources;
+ Sources sources;
Uses uses (tu, by_value_key, failed);
schema >> sources >> schema;