diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-06-07 15:05:30 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2021-06-07 15:05:30 +0200 |
| commit | 263de03914a3de5d55c4508c322e32d36caf2a87 (patch) | |
| tree | c279464365fd7683744fa59d01b242e4b3ab17b9 /Samples/common/src/ImlParsing/Syntax.cs | |
| parent | f738cf0f78c57750cce8fd5744825b0591f24bb8 (diff) | |
suggestion in IML editor, editor base classe for ShowCase and LogAnalyzerSimplifiedTabView
Diffstat (limited to 'Samples/common/src/ImlParsing/Syntax.cs')
| -rw-r--r-- | Samples/common/src/ImlParsing/Syntax.cs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Samples/common/src/ImlParsing/Syntax.cs b/Samples/common/src/ImlParsing/Syntax.cs index fd410eaf..a38e1558 100644 --- a/Samples/common/src/ImlParsing/Syntax.cs +++ b/Samples/common/src/ImlParsing/Syntax.cs @@ -128,8 +128,12 @@ namespace Crow Exceptions.Add (new SyntaxException ("Extra equal sign in attribute syntax", iter.Current)); else attrib.EqualToken = iter.Current; - else if (iter.Current.Type == TokenType.AttributeValue) { - attrib.ValueToken = attrib.EndToken = iter.Current; + else if (iter.Current.Type == TokenType.AttributeValueOpen) + attrib.ValueOpenToken = iter.Current; + else if (iter.Current.Type == TokenType.AttributeValue) + attrib.ValueToken = iter.Current; + else if (iter.Current.Type == TokenType.AttributeValueClose) { + attrib.ValueCloseToken = attrib.EndToken = iter.Current; CurrentNode = CurrentNode.Parent; } else { Exceptions.Add (new SyntaxException ("Unexpected Token", iter.Current)); @@ -232,7 +236,7 @@ namespace Crow public XmlSource Source => Root.source; public bool Contains (int pos) => EndToken.HasValue ? - StartToken.Start <= pos && EndToken.Value.End >= pos : false; + StartToken.Start <= pos && EndToken.Value.End > pos : false; public void Dump (int level = 0) { Console.WriteLine ($"{new string('\t', level)}{this}"); @@ -303,8 +307,10 @@ namespace Crow public class AttributeSyntax : SyntaxNode { public Token? NameToken { get; internal set; } public Token? EqualToken { get; internal set; } + public Token? ValueOpenToken { get; internal set; } + public Token? ValueCloseToken { get; internal set; } public Token? ValueToken { get; internal set; } public AttributeSyntax (Token startTok) : base (startTok) {} - public override bool IsComplete => base.IsComplete & NameToken.HasValue & EqualToken.HasValue & ValueToken.HasValue; + public override bool IsComplete => base.IsComplete & NameToken.HasValue & EqualToken.HasValue & ValueToken.HasValue & ValueOpenToken.HasValue & ValueCloseToken.HasValue; } }
\ No newline at end of file |