Chromium Code Reviews| Index: lib/compiler/implementation/js/precedence.dart |
| diff --git a/lib/compiler/implementation/js/precedence.dart b/lib/compiler/implementation/js/precedence.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b409af44df8985922baeb8e46bddc0cfc39da1d2 |
| --- /dev/null |
| +++ b/lib/compiler/implementation/js/precedence.dart |
| @@ -0,0 +1,25 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// for details. All rights reserved. Use of this source code is governed by a |
| +// BSD-style license that can be found in the LICENSE file. |
| + |
| +#library("precedence"); |
| + |
| +final EXPRESSION = 0; |
| +final ASSIGNMENT = EXPRESSION + 1; |
| +final LOGICAL_OR = ASSIGNMENT + 1; |
| +final LOGICAL_AND = LOGICAL_OR + 1; |
| +final BIT_OR = LOGICAL_AND + 1; |
| +final BIT_XOR = BIT_OR + 1; |
| +final BIT_AND = BIT_XOR + 1; |
| +final EQUALITY = BIT_AND + 1; |
| +final RELATIONAL = EQUALITY + 1; |
| +final SHIFT = RELATIONAL + 1; |
| +final ADDITIVE = SHIFT + 1; |
| +final MULTIPLICATIVE = ADDITIVE + 1; |
| +final UNARY = MULTIPLICATIVE + 1; |
| +// We merge new, call and member expressions. |
| +// This means that we have to emit parenthesis for 'new's. For example `new X;` |
| +// should be printed as `new X();`. This simplifies the requirements. |
| +final LHS = UNARY + 1; |
| +final CALL = LHS; |
| +final PRIMARY = CALL + 1; |
|
Lasse Reichstein Nielsen
2012/08/08 11:16:38
Seems to be missing a "member" precedence, or do y
floitsch
2012/08/09 16:24:07
Moved comment from LHS down to CALL.
|