| 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.parser; | 5 library polymer_expressions.parser; |
| 6 | 6 |
| 7 import 'tokenizer.dart'; | 7 import 'tokenizer.dart'; |
| 8 import 'expression.dart'; | 8 import 'expression.dart'; |
| 9 | 9 |
| 10 const _UNARY_OPERATORS = const ['+', '-', '!']; | 10 const _UNARY_OPERATORS = const ['+', '-', '!']; |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 | 189 |
| 190 Expression _parseInvokeOrIdentifier() { | 190 Expression _parseInvokeOrIdentifier() { |
| 191 if (_token.value == 'true') { | 191 if (_token.value == 'true') { |
| 192 _advance(); | 192 _advance(); |
| 193 return _astFactory.literal(true); | 193 return _astFactory.literal(true); |
| 194 } | 194 } |
| 195 if (_token.value == 'false') { | 195 if (_token.value == 'false') { |
| 196 _advance(); | 196 _advance(); |
| 197 return _astFactory.literal(false); | 197 return _astFactory.literal(false); |
| 198 } | 198 } |
| 199 if (_token.value == 'null') { |
| 200 _advance(); |
| 201 return _astFactory.literal(null); |
| 202 } |
| 199 var identifier = _parseIdentifier(); | 203 var identifier = _parseIdentifier(); |
| 200 var args = _parseArguments(); | 204 var args = _parseArguments(); |
| 201 if (args == null) { | 205 if (args == null) { |
| 202 return identifier; | 206 return identifier; |
| 203 } else { | 207 } else { |
| 204 return _astFactory.invoke(identifier, null, args); | 208 return _astFactory.invoke(identifier, null, args); |
| 205 } | 209 } |
| 206 } | 210 } |
| 207 | 211 |
| 208 Invoke _parseInvoke() { | 212 Invoke _parseInvoke() { |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 return value; | 270 return value; |
| 267 } | 271 } |
| 268 | 272 |
| 269 Literal<double> _parseDecimal([String prefix = '']) { | 273 Literal<double> _parseDecimal([String prefix = '']) { |
| 270 var value = _astFactory.literal(double.parse('$prefix${_token.value}')); | 274 var value = _astFactory.literal(double.parse('$prefix${_token.value}')); |
| 271 _advance(); | 275 _advance(); |
| 272 return value; | 276 return value; |
| 273 } | 277 } |
| 274 | 278 |
| 275 } | 279 } |
| OLD | NEW |