| 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; |
| 11 const int _CR = 13; | 11 const int _CR = 13; |
| 12 const int _SPACE = 32; | 12 const int _SPACE = 32; |
| 13 const int _BANG = 33; | 13 const int _BANG = 33; |
| 14 const int _DQ = 34; | 14 const int _DQ = 34; |
| 15 const int _$ = 36; | 15 const int _$ = 36; |
| 16 const int _PERCENT = 37; |
| 16 const int _AMPERSAND = 38; | 17 const int _AMPERSAND = 38; |
| 17 const int _SQ = 39; | 18 const int _SQ = 39; |
| 18 const int _OPEN_PAREN = 40; | 19 const int _OPEN_PAREN = 40; |
| 19 const int _CLOSE_PAREN = 41; | 20 const int _CLOSE_PAREN = 41; |
| 20 const int _STAR = 42; | 21 const int _STAR = 42; |
| 21 const int _PLUS = 43; | 22 const int _PLUS = 43; |
| 22 const int _COMMA = 44; | 23 const int _COMMA = 44; |
| 23 const int _MINUS = 45; | 24 const int _MINUS = 45; |
| 24 const int _PERIOD = 46; | 25 const int _PERIOD = 46; |
| 25 const int _SLASH = 47; | 26 const int _SLASH = 47; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 43 const int _r = 114; | 44 const int _r = 114; |
| 44 const int _t = 116; | 45 const int _t = 116; |
| 45 const int _v = 118; | 46 const int _v = 118; |
| 46 const int _z = 122; | 47 const int _z = 122; |
| 47 const int _OPEN_CURLY_BRACKET = 123; | 48 const int _OPEN_CURLY_BRACKET = 123; |
| 48 const int _BAR = 124; | 49 const int _BAR = 124; |
| 49 const int _CLOSE_CURLY_BRACKET = 125; | 50 const int _CLOSE_CURLY_BRACKET = 125; |
| 50 const int _NBSP = 160; | 51 const int _NBSP = 160; |
| 51 | 52 |
| 52 const _OPERATORS = const [_PLUS, _MINUS, _STAR, _SLASH, _BANG, _AMPERSAND, | 53 const _OPERATORS = const [_PLUS, _MINUS, _STAR, _SLASH, _BANG, _AMPERSAND, |
| 53 /*_COMMA,*/ _LT, _EQ, _GT, _QUESTION, _CARET, _BAR]; | 54 _PERCENT, _LT, _EQ, _GT, _QUESTION, _CARET, _BAR]; |
| 54 | 55 |
| 55 const _GROUPERS = const [_OPEN_PAREN, _CLOSE_PAREN, | 56 const _GROUPERS = const [_OPEN_PAREN, _CLOSE_PAREN, |
| 56 _OPEN_SQUARE_BRACKET, _CLOSE_SQUARE_BRACKET, | 57 _OPEN_SQUARE_BRACKET, _CLOSE_SQUARE_BRACKET, |
| 57 _OPEN_CURLY_BRACKET, _CLOSE_CURLY_BRACKET]; | 58 _OPEN_CURLY_BRACKET, _CLOSE_CURLY_BRACKET]; |
| 58 | 59 |
| 59 const _TWO_CHAR_OPS = const ['==', '!=', '<=', '>=', '||', '&&']; | 60 const _TWO_CHAR_OPS = const ['==', '!=', '<=', '>=', '||', '&&']; |
| 60 | 61 |
| 61 const _KEYWORDS = const ['in', 'this']; | 62 const _KEYWORDS = const ['in', 'this']; |
| 62 | 63 |
| 63 const _PRECEDENCE = const { | 64 const _PRECEDENCE = const { |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 _tokens.add(new Token(GROUPER_TOKEN, value, _PRECEDENCE[value])); | 292 _tokens.add(new Token(GROUPER_TOKEN, value, _PRECEDENCE[value])); |
| 292 _advance(); | 293 _advance(); |
| 293 } | 294 } |
| 294 } | 295 } |
| 295 | 296 |
| 296 class ParseException implements Exception { | 297 class ParseException implements Exception { |
| 297 final String message; | 298 final String message; |
| 298 ParseException(this.message); | 299 ParseException(this.message); |
| 299 String toString() => "ParseException: $message"; | 300 String toString() => "ParseException: $message"; |
| 300 } | 301 } |
| OLD | NEW |