@@ -32,6 +32,11 @@ public static Token Value(string text, bool explicitlyAssigned)
32
32
return new Value ( text , explicitlyAssigned ) ;
33
33
}
34
34
35
+ public static Token ValueForced ( string text )
36
+ {
37
+ return new Value ( text , false , true ) ;
38
+ }
39
+
35
40
public TokenType Tag
36
41
{
37
42
get { return tag ; }
@@ -80,23 +85,35 @@ public bool Equals(Name other)
80
85
class Value : Token , IEquatable < Value >
81
86
{
82
87
private readonly bool explicitlyAssigned ;
88
+ private readonly bool forced ;
83
89
84
90
public Value ( string text )
85
- : this ( text , false )
91
+ : this ( text , false , false )
86
92
{
87
93
}
88
94
89
95
public Value ( string text , bool explicitlyAssigned )
96
+ : this ( text , explicitlyAssigned , false )
97
+ {
98
+ }
99
+
100
+ public Value ( string text , bool explicitlyAssigned , bool forced )
90
101
: base ( TokenType . Value , text )
91
102
{
92
103
this . explicitlyAssigned = explicitlyAssigned ;
104
+ this . forced = forced ;
93
105
}
94
106
95
107
public bool ExplicitlyAssigned
96
108
{
97
109
get { return explicitlyAssigned ; }
98
110
}
99
111
112
+ public bool Forced
113
+ {
114
+ get { return forced ; }
115
+ }
116
+
100
117
public override bool Equals ( object obj )
101
118
{
102
119
var other = obj as Value ;
@@ -120,7 +137,7 @@ public bool Equals(Value other)
120
137
return false ;
121
138
}
122
139
123
- return Tag . Equals ( other . Tag ) && Text . Equals ( other . Text ) ;
140
+ return Tag . Equals ( other . Tag ) && Text . Equals ( other . Text ) && this . Forced == other . Forced ;
124
141
}
125
142
}
126
143
@@ -135,5 +152,10 @@ public static bool IsValue(this Token token)
135
152
{
136
153
return token . Tag == TokenType . Value ;
137
154
}
155
+
156
+ public static bool IsValueForced ( this Token token )
157
+ {
158
+ return token . IsValue ( ) && ( ( Value ) token ) . Forced ;
159
+ }
138
160
}
139
- }
161
+ }
0 commit comments