2004-11-28 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Sun, 28 Nov 2004 16:33:28 +0000 (16:33 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Sun, 28 Nov 2004 16:33:28 +0000 (16:33 -0000)
* RelaxngGrammar.cs : fixed error that happened on recompilation.

svn path=/trunk/mcs/; revision=36721

mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng/ChangeLog
mcs/class/Commons.Xml.Relaxng/Commons.Xml.Relaxng/RelaxngGrammar.cs

index 7a177d9bdd26cb6aa1e6bc9bd9b953461c8b784d..e75d16ebb250af069275808dcf6f5362b84dbb81 100644 (file)
@@ -1,3 +1,7 @@
+2004-11-28  Atsushi Enomoto <atsushi@ximian.com>
+
+       * RelaxngGrammar.cs : fixed error that happened on recompilation.
+
 2004-07-14  Atsushi Enomoto <atsushi@ximian.com>
 
        * RelaxngGrammar.cs : When definition is missing, the error message
index 3fc654fe635baa8dc1ed0b7af3e2d54fbea62ebb..41115e62745bea4859ff23766caee128622fd933 100644 (file)
@@ -83,6 +83,21 @@ namespace Commons.Xml.Relaxng
                {\r
                }\r
 \r
+               private void ResetCompileState ()\r
+               {\r
+                       startPattern = null;\r
+                       assembledDefs.Clear ();\r
+                       assembledStart = null;\r
+                       compiledStart = null;\r
+                       elementReplacedDefs.Clear ();\r
+                       includedUris.Clear ();\r
+                       parentGrammar = null;\r
+                       refPatterns.Clear ();\r
+                       checkedDefs.Clear ();\r
+                       unresolvedPatterns.Clear ();\r
+                       ElementDefMap.Clear ();\r
+               }\r
+\r
                internal RelaxngGrammar ParentGrammar {\r
                        get { return parentGrammar; }\r
                        set { parentGrammar = value; }\r
@@ -148,6 +163,8 @@ namespace Commons.Xml.Relaxng
                // Compile from this simplified syntax to derivatives.\r
                internal override RdpPattern Compile (RelaxngGrammar grammar)\r
                {\r
+                       ResetCompileState ();\r
+\r
                        parentGrammar = grammar;\r
 \r
                        // First, process includes and divs. RELAX NG 4.1 - 4.15.\r