Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1323)

Side by Side Diff: pkg/polymer_expressions/lib/tokenizer.dart

Issue 148883006: polymer_expressions: Add % as an operator. Test all operators.. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/polymer_expressions/test/parser_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | pkg/polymer_expressions/test/parser_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698