1
// ****************************************************************
2
// This is free software licensed under the NUnit license. You may
3
// obtain a copy of the license at http://nunit.org
4
// ****************************************************************
7
using System.Collections.Generic;
10
namespace NUnit.UiException.CodeFormatters
13
/// This enum indicate the kind of a string sequence.
15
public enum ClassificationTag : byte
18
/// The string refer to C# source code.
23
/// The string refers to C# keywords.
28
/// The string refers to C# comments.
33
/// The string refers to a string/char value.
39
/// (formerly named CSToken)
41
/// Classifies a string and make it falls into one of the categories below:
42
/// - Code (the value should be interpreted as regular code)
43
/// - Keyword (the value should be interpreted as a language keyword)
44
/// - Comment (the value should be interpreted as comments)
45
/// - String (the value should be interpreted as a string)
47
public class ClassifiedToken
50
/// The string held by this token.
52
protected string _text;
57
protected ClassificationTag _tag;
60
/// Starting startingPosition of the string.
62
protected int _indexStart;
65
/// This class cannot be build directly.
67
protected ClassifiedToken()
69
// this class requires subclassing
73
/// Gets the string value.
77
get { return (_text); }
81
/// Gets the classification value for the string in Text.
82
/// - Code: Text should be interpreted as regular code,
83
/// - Keyword: Text should be interpreted as a language keyword,
84
/// - Comments: Text should be interpreted as comments,
85
/// - String: Text should be interpreted as a string.
87
public ClassificationTag Tag
89
get { return (_tag); }
93
/// Gets the string's starting startingPosition.
97
get { return (_indexStart); }
101
/// Returns true if 'obj' is an instance of ClassifiedToken
102
/// that contains same data that the current instance.
104
public override bool Equals(object obj)
106
ClassifiedToken token;
108
if (obj == null || !(obj is ClassifiedToken))
111
token = obj as ClassifiedToken;
113
return (Text == token.Text &&
117
public override int GetHashCode()
119
return base.GetHashCode();
122
public override string ToString()
124
return (String.Format(
125
"ClassifiedToken {Text='{0}', Tag={1}}",
1
// ****************************************************************
2
// This is free software licensed under the NUnit license. You may
3
// obtain a copy of the license at http://nunit.org
4
// ****************************************************************
7
using System.Collections.Generic;
10
namespace NUnit.UiException.CodeFormatters
13
/// This enum indicate the kind of a string sequence.
15
public enum ClassificationTag : byte
18
/// The string refer to C# source code.
23
/// The string refers to C# keywords.
28
/// The string refers to C# comments.
33
/// The string refers to a string/char value.
39
/// (formerly named CSToken)
41
/// Classifies a string and make it falls into one of the categories below:
42
/// - Code (the value should be interpreted as regular code)
43
/// - Keyword (the value should be interpreted as a language keyword)
44
/// - Comment (the value should be interpreted as comments)
45
/// - String (the value should be interpreted as a string)
47
public class ClassifiedToken
50
/// The string held by this token.
52
protected string _text;
57
protected ClassificationTag _tag;
60
/// Starting startingPosition of the string.
62
protected int _indexStart;
65
/// This class cannot be build directly.
67
protected ClassifiedToken()
69
// this class requires subclassing
73
/// Gets the string value.
77
get { return (_text); }
81
/// Gets the classification value for the string in Text.
82
/// - Code: Text should be interpreted as regular code,
83
/// - Keyword: Text should be interpreted as a language keyword,
84
/// - Comments: Text should be interpreted as comments,
85
/// - String: Text should be interpreted as a string.
87
public ClassificationTag Tag
89
get { return (_tag); }
93
/// Gets the string's starting startingPosition.
97
get { return (_indexStart); }
101
/// Returns true if 'obj' is an instance of ClassifiedToken
102
/// that contains same data that the current instance.
104
public override bool Equals(object obj)
106
ClassifiedToken token;
108
if (obj == null || !(obj is ClassifiedToken))
111
token = obj as ClassifiedToken;
113
return (Text == token.Text &&
117
public override int GetHashCode()
119
return base.GetHashCode();
122
public override string ToString()
124
return (String.Format(
125
"ClassifiedToken {Text='{0}', Tag={1}}",