@@ -32,6 +32,11 @@ public static Token Value(string text, bool explicitlyAssigned)
3232 return new Value ( text , explicitlyAssigned ) ;
3333 }
3434
35+ public static Token ValueForced ( string text )
36+ {
37+ return new Value ( text , false , true ) ;
38+ }
39+
3540 public TokenType Tag
3641 {
3742 get { return tag ; }
@@ -80,23 +85,35 @@ public bool Equals(Name other)
8085 class Value : Token , IEquatable < Value >
8186 {
8287 private readonly bool explicitlyAssigned ;
88+ private readonly bool forced ;
8389
8490 public Value ( string text )
85- : this ( text , false )
91+ : this ( text , false , false )
8692 {
8793 }
8894
8995 public Value ( string text , bool explicitlyAssigned )
96+ : this ( text , explicitlyAssigned , false )
97+ {
98+ }
99+
100+ public Value ( string text , bool explicitlyAssigned , bool forced )
90101 : base ( TokenType . Value , text )
91102 {
92103 this . explicitlyAssigned = explicitlyAssigned ;
104+ this . forced = forced ;
93105 }
94106
95107 public bool ExplicitlyAssigned
96108 {
97109 get { return explicitlyAssigned ; }
98110 }
99111
112+ public bool Forced
113+ {
114+ get { return forced ; }
115+ }
116+
100117 public override bool Equals ( object obj )
101118 {
102119 var other = obj as Value ;
@@ -120,7 +137,7 @@ public bool Equals(Value other)
120137 return false ;
121138 }
122139
123- return Tag . Equals ( other . Tag ) && Text . Equals ( other . Text ) ;
140+ return Tag . Equals ( other . Tag ) && Text . Equals ( other . Text ) && this . Forced == other . Forced ;
124141 }
125142 }
126143
@@ -135,5 +152,10 @@ public static bool IsValue(this Token token)
135152 {
136153 return token . Tag == TokenType . Value ;
137154 }
155+
156+ public static bool IsValueForced ( this Token token )
157+ {
158+ return token . IsValue ( ) && ( ( Value ) token ) . Forced ;
159+ }
138160 }
139- }
161+ }
0 commit comments