Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/addins/Xml/Parser/XmlTagState.cs')
-rw-r--r--main/src/addins/Xml/Parser/XmlTagState.cs84
1 files changed, 42 insertions, 42 deletions
diff --git a/main/src/addins/Xml/Parser/XmlTagState.cs b/main/src/addins/Xml/Parser/XmlTagState.cs
index 20de1d46ec..604613a88c 100644
--- a/main/src/addins/Xml/Parser/XmlTagState.cs
+++ b/main/src/addins/Xml/Parser/XmlTagState.cs
@@ -27,19 +27,19 @@
//
using System;
-using System.Diagnostics;
-using ICSharpCode.NRefactory;
-using MonoDevelop.Xml.Dom;
-
+using System.Diagnostics;
+using MonoDevelop.Xml.Dom;
+using MonoDevelop.Ide.Editor;
+
namespace MonoDevelop.Xml.Parser
{
public class XmlTagState : XmlParserState
- {
- const int ATTEMPT_RECOVERY = 1;
- const int RECOVERY_FOUND_WHITESPACE = 2;
- const int MAYBE_SELF_CLOSING = 2;
+ {
+ const int ATTEMPT_RECOVERY = 1;
+ const int RECOVERY_FOUND_WHITESPACE = 2;
+ const int MAYBE_SELF_CLOSING = 2;
const int OK = 0;
readonly XmlAttributeState AttributeState;
@@ -49,16 +49,16 @@ namespace MonoDevelop.Xml.Parser
public XmlTagState (XmlAttributeState attributeState)
: this (attributeState, new XmlNameState ()) {}
-
- public XmlTagState (XmlAttributeState attributeState, XmlNameState nameState)
+
+ public XmlTagState (XmlAttributeState attributeState, XmlNameState nameState)
{
this.AttributeState = attributeState;
this.NameState = nameState;
Adopt (this.AttributeState);
- Adopt (this.NameState);
+ Adopt (this.NameState);
}
-
+
public override XmlParserState PushChar (char c, IXmlParserContext context, ref string rollback)
{
XElement element = context.Nodes.Peek () as XElement;
@@ -105,33 +105,33 @@ namespace MonoDevelop.Xml.Parser
Close (element, context, context.Location);
}
return Parent;
- }
-
- if (c == '/') {
- context.StateTag = MAYBE_SELF_CLOSING;
- return null;
- }
-
- if (context.StateTag == ATTEMPT_RECOVERY) {
- if (XmlChar.IsWhitespace (c)) {
- context.StateTag = RECOVERY_FOUND_WHITESPACE;
- }
- return null;
- }
-
- if (context.StateTag == RECOVERY_FOUND_WHITESPACE) {
- if (!XmlChar.IsFirstNameChar (c))
- return null;
- }
-
- context.StateTag = OK;
-
+ }
+
+ if (c == '/') {
+ context.StateTag = MAYBE_SELF_CLOSING;
+ return null;
+ }
+
+ if (context.StateTag == ATTEMPT_RECOVERY) {
+ if (XmlChar.IsWhitespace (c)) {
+ context.StateTag = RECOVERY_FOUND_WHITESPACE;
+ }
+ return null;
+ }
+
+ if (context.StateTag == RECOVERY_FOUND_WHITESPACE) {
+ if (!XmlChar.IsFirstNameChar (c))
+ return null;
+ }
+
+ context.StateTag = OK;
+
if (!element.IsNamed && XmlChar.IsFirstNameChar (c)) {
rollback = string.Empty;
- return NameState;
- }
-
- if (context.CurrentStateLength > 1 && XmlChar.IsFirstNameChar (c)) {
+ return NameState;
+ }
+
+ if (context.CurrentStateLength > 1 && XmlChar.IsFirstNameChar (c)) {
rollback = string.Empty;
return AttributeState;
}
@@ -139,17 +139,17 @@ namespace MonoDevelop.Xml.Parser
if (XmlChar.IsWhitespace (c))
return null;
- context.LogError ("Unexpected character '" + c + "' in tag.", context.LocationMinus (1));
+ context.LogError ("Unexpected character '" + c + "' in tag.", context.LocationMinus (1));
context.StateTag = ATTEMPT_RECOVERY;
- return null;
+ return null;
}
- protected virtual void Close (XElement element, IXmlParserContext context, TextLocation location)
+ protected virtual void Close (XElement element, IXmlParserContext context, DocumentLocation location)
{
//have already checked that element is not null, i.e. top of stack is our element
if (element.IsClosed)
- context.Nodes.Pop ();
-
+ context.Nodes.Pop ();
+
element.End (location);
if (context.BuildTree) {
XContainer container = element.IsClosed?