File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ public string FormatTokens(IEnumerable<Token> tokens)
9
9
{
10
10
var sb = new StringBuilder ( ) ;
11
11
12
- foreach ( var token in tokens )
12
+ foreach ( Token token in tokens )
13
13
{
14
14
string s = token . ToString ( ) ! ;
15
- if ( token is not VariableToken && s . Length > 1 ) s = $ "[[{ s } ]]";
15
+ if ( token is OperatorToken && s . Length > 1 ) s = $ "[[{ s } ]]";
16
16
sb . Append ( s ) ;
17
17
}
18
18
Original file line number Diff line number Diff line change @@ -31,10 +31,10 @@ public string FormatTokens(IEnumerable<Token> tokens)
31
31
{
32
32
var sb = new StringBuilder ( ) ;
33
33
34
- foreach ( var token in tokens )
34
+ foreach ( Token token in tokens )
35
35
{
36
36
string s = token . ToString ( ) ! ;
37
- if ( token is not VariableToken && s . Length > 1 ) s = $ "[[{ s } ]]";
37
+ if ( token is OperatorToken && s . Length > 1 ) s = $ "[[{ s } ]]";
38
38
sb . Append ( s ) ;
39
39
}
40
40
Original file line number Diff line number Diff line change @@ -5,5 +5,5 @@ protected OperatorToken(int precedence)
5
5
Precedence = precedence ;
6
6
}
7
7
8
- public int Precedence { get ; protected set ; }
8
+ public int Precedence { get ; protected set ; }
9
9
}
Original file line number Diff line number Diff line change 1
- abstract class Token { }
1
+ abstract class Token
2
+ {
3
+ public abstract override string ToString ( ) ;
4
+ }
You can’t perform that action at this time.
0 commit comments