| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library polymer_expressions.tokenizer; | 5 library polymer_expressions.tokenizer; |
| 6 | 6 |
| 7 const int _TAB = 9; | 7 const int _TAB = 9; |
| 8 const int _LF = 10; | 8 const int _LF = 10; |
| 9 const int _VTAB = 11; | 9 const int _VTAB = 11; |
| 10 const int _FF = 12; | 10 const int _FF = 12; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 | 52 |
| 53 const _OPERATORS = const [_PLUS, _MINUS, _STAR, _SLASH, _BANG, _AMPERSAND, | 53 const _OPERATORS = const [_PLUS, _MINUS, _STAR, _SLASH, _BANG, _AMPERSAND, |
| 54 _PERCENT, _LT, _EQ, _GT, _QUESTION, _CARET, _BAR]; | 54 _PERCENT, _LT, _EQ, _GT, _QUESTION, _CARET, _BAR]; |
| 55 | 55 |
| 56 const _GROUPERS = const [_OPEN_PAREN, _CLOSE_PAREN, | 56 const _GROUPERS = const [_OPEN_PAREN, _CLOSE_PAREN, |
| 57 _OPEN_SQUARE_BRACKET, _CLOSE_SQUARE_BRACKET, | 57 _OPEN_SQUARE_BRACKET, _CLOSE_SQUARE_BRACKET, |
| 58 _OPEN_CURLY_BRACKET, _CLOSE_CURLY_BRACKET]; | 58 _OPEN_CURLY_BRACKET, _CLOSE_CURLY_BRACKET]; |
| 59 | 59 |
| 60 const _TWO_CHAR_OPS = const ['==', '!=', '<=', '>=', '||', '&&']; | 60 const _TWO_CHAR_OPS = const ['==', '!=', '<=', '>=', '||', '&&']; |
| 61 | 61 |
| 62 const _KEYWORDS = const ['in', 'this']; | 62 const _KEYWORDS = const ['as', 'in', 'this']; |
| 63 | 63 |
| 64 const _PRECEDENCE = const { | 64 const _PRECEDENCE = const { |
| 65 '!': 0, | 65 '!': 0, |
| 66 ':': 0, | 66 ':': 0, |
| 67 ',': 0, | 67 ',': 0, |
| 68 ')': 0, | 68 ')': 0, |
| 69 ']': 0, | 69 ']': 0, |
| 70 '}': 0, // ? | 70 '}': 0, // ? |
| 71 '?': 1, | 71 '?': 1, |
| 72 '||': 2, | 72 '||': 2, |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 _tokens.add(new Token(GROUPER_TOKEN, value, _PRECEDENCE[value])); | 292 _tokens.add(new Token(GROUPER_TOKEN, value, _PRECEDENCE[value])); |
| 293 _advance(); | 293 _advance(); |
| 294 } | 294 } |
| 295 } | 295 } |
| 296 | 296 |
| 297 class ParseException implements Exception { | 297 class ParseException implements Exception { |
| 298 final String message; | 298 final String message; |
| 299 ParseException(this.message); | 299 ParseException(this.message); |
| 300 String toString() => "ParseException: $message"; | 300 String toString() => "ParseException: $message"; |
| 301 } | 301 } |
| OLD | NEW |