@@ -88,51 +88,48 @@ class BinaryOperationExpression implements Expression {
8888/// A binary operator constant.
8989///
9090/// {@category AST}
91- @sealed
92- class BinaryOperator {
91+ enum BinaryOperator {
9392 /// The Microsoft equals operator, `=` .
94- static const singleEquals = BinaryOperator ._( " single equals" , "=" , 0 );
93+ singleEquals ( ' single equals' , '=' , 0 ),
9594
9695 /// The disjunction operator, `or` .
97- static const or = BinaryOperator ._( "or" , "or" , 1 );
96+ or ( 'or' , 'or' , 1 ),
9897
9998 /// The conjunction operator, `and` .
100- static const and = BinaryOperator ._( " and" , " and" , 2 );
99+ and ( ' and' , ' and' , 2 ),
101100
102101 /// The equality operator, `==` .
103- static const equals = BinaryOperator ._( " equals" , "==" , 3 );
102+ equals ( ' equals' , '==' , 3 ),
104103
105104 /// The inequality operator, `!=` .
106- static const notEquals = BinaryOperator ._( " not equals" , "!=" , 3 );
105+ notEquals ( ' not equals' , '!=' , 3 ),
107106
108107 /// The greater-than operator, `>` .
109- static const greaterThan = BinaryOperator ._( " greater than" , ">" , 4 );
108+ greaterThan ( ' greater than' , '>' , 4 ),
110109
111110 /// The greater-than-or-equal-to operator, `>=` .
112- static const greaterThanOrEquals =
113- BinaryOperator ._("greater than or equals" , ">=" , 4 );
111+ greaterThanOrEquals ('greater than or equals' , '>=' , 4 ),
114112
115113 /// The less-than operator, `<` .
116- static const lessThan = BinaryOperator ._( " less than" , "<" , 4 );
114+ lessThan ( ' less than' , '<' , 4 ),
117115
118116 /// The less-than-or-equal-to operator, `<=` .
119- static const lessThanOrEquals =
120- BinaryOperator ._("less than or equals" , "<=" , 4 );
117+ lessThanOrEquals ('less than or equals' , '<=' , 4 ),
121118
122119 /// The addition operator, `+` .
123- static const plus = BinaryOperator ._( " plus" , "+" , 5 );
120+ plus ( ' plus' , '+' , 5 ),
124121
125122 /// The subtraction operator, `-` .
126- static const minus = BinaryOperator ._( " minus" , "-" , 5 );
123+ minus ( ' minus' , '-' , 5 ),
127124
128125 /// The multiplication operator, `*` .
129- static const times = BinaryOperator ._( " times" , "*" , 6 );
126+ times ( ' times' , '*' , 6 ),
130127
131128 /// The division operator, `/` .
132- static const dividedBy = BinaryOperator ._( " divided by" , "/" , 6 );
129+ dividedBy ( ' divided by' , '/' , 6 ),
133130
134131 /// The modulo operator, `%` .
135- static const modulo = BinaryOperator ._( " modulo" , "%" , 6 );
132+ modulo ( ' modulo' , '%' , 6 );
136133
137134 /// The English name of [this] .
138135 final String name;
@@ -145,7 +142,7 @@ class BinaryOperator {
145142 /// An operator with higher precedence binds tighter.
146143 final int precedence;
147144
148- const BinaryOperator ._ (this .name, this .operator , this .precedence);
145+ const BinaryOperator (this .name, this .operator , this .precedence);
149146
150147 String toString () => name;
151148}
0 commit comments