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 // Utilities for building JS ASTs at runtime. Contains a builder class | 5 // Utilities for building JS ASTs at runtime. Contains a builder class |
6 // and a parser that parses part of the language. | 6 // and a parser that parses part of the language. |
7 | 7 |
8 part of js_ast; | 8 part of js_ast; |
9 | 9 |
10 /** | 10 /** |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 /// AST nodes. Handles: | 414 /// AST nodes. Handles: |
415 /// * identifiers. | 415 /// * identifiers. |
416 /// * dot access. | 416 /// * dot access. |
417 /// * method calls. | 417 /// * method calls. |
418 /// * [] access. | 418 /// * [] access. |
419 /// * array, string, regexp, boolean, null and numeric literals. | 419 /// * array, string, regexp, boolean, null and numeric literals. |
420 /// * most operators. | 420 /// * most operators. |
421 /// * brackets. | 421 /// * brackets. |
422 /// * var declarations. | 422 /// * var declarations. |
423 /// * operator precedence. | 423 /// * operator precedence. |
424 /// * anonymous funtions and named function expressions and declarations. | 424 /// * anonymous functions and named function expressions and declarations. |
425 /// Notable things it can't do yet include: | 425 /// Notable things it can't do yet include: |
426 /// * some statements are still missing (do-while, while, switch). | 426 /// * some statements are still missing (do-while, while, switch). |
427 /// | 427 /// |
428 /// It's a fairly standard recursive descent parser. | 428 /// It's a fairly standard recursive descent parser. |
429 /// | 429 /// |
430 /// Literal strings are passed through to the final JS source code unchanged, | 430 /// Literal strings are passed through to the final JS source code unchanged, |
431 /// including the choice of surrounding quotes, so if you parse | 431 /// including the choice of surrounding quotes, so if you parse |
432 /// r'var x = "foo\n\"bar\""' you will end up with | 432 /// r'var x = "foo\n\"bar\""' you will end up with |
433 /// var x = "foo\n\"bar\"" in the final program. \x and \u escapes are not | 433 /// var x = "foo\n\"bar\"" in the final program. \x and \u escapes are not |
434 /// allowed in string and regexp literals because the machinery for checking | 434 /// allowed in string and regexp literals because the machinery for checking |
(...skipping 1269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1704 expectCategory(RSQUARE); | 1704 expectCategory(RSQUARE); |
1705 return expr; | 1705 return expr; |
1706 } else if (acceptCategory(HASH)) { | 1706 } else if (acceptCategory(HASH)) { |
1707 return parseInterpolatedExpression(); | 1707 return parseInterpolatedExpression(); |
1708 } else { | 1708 } else { |
1709 error('Expected property name'); | 1709 error('Expected property name'); |
1710 return null; | 1710 return null; |
1711 } | 1711 } |
1712 } | 1712 } |
1713 } | 1713 } |
OLD | NEW |