OLD | NEW |
1 <!-- | 1 <!-- |
2 Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 2 Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
3 for details. All rights reserved. Use of this source code is governed by a | 3 for details. All rights reserved. Use of this source code is governed by a |
4 BSD-style license that can be found in the LICENSE file. | 4 BSD-style license that can be found in the LICENSE file. |
5 --> | 5 --> |
6 | 6 |
7 # Uses of peek in the parser | 7 # Uses of peek in the parser |
8 | 8 |
9 * In parseTypedef, the parser uses peekAfterNominalType to select between old | |
10 style and new style. | |
11 | |
12 * In parseClassOrNamedMixinApplication, the parser uses peekAfterNominalType | |
13 to select between named mixin application or class declaration. | |
14 | |
15 * In parseClass, the parser uses peekAfterNominalType to select between a | 9 * In parseClass, the parser uses peekAfterNominalType to select between a |
16 mixin application and a regular extends. | 10 mixin application and a regular extends. |
17 | 11 |
18 * In parseType, the parser uses peekAfterIfType to tell the difference | 12 * In parseType, the parser uses peekAfterIfType to tell the difference |
19 between `id` and `id id`. | 13 between `id` and `id id`. |
20 | 14 |
21 * In parseExpressionStatementOrDeclaration, the parser uses | 15 * In parseExpressionStatementOrDeclaration, the parser uses |
22 peekIdentifierAfterType to select between an expression statement or a | 16 peekIdentifierAfterType to select between an expression statement or a |
23 local (function or variable) declaration. | 17 local (function or variable) declaration. |
24 | 18 |
25 * In parseExpressionStatementOrConstDeclaration, the parser uses | 19 * In parseExpressionStatementOrConstDeclaration, the parser uses |
26 peekIdentifierAfterOptionalType to select between an expression statement | 20 peekIdentifierAfterOptionalType to select between an expression statement |
27 and a const local variable. | 21 and a const local variable. |
28 | 22 |
29 * In parseSendOrFunctionLiteral, the parser uses peekAfterIfType to select | 23 * In parseSendOrFunctionLiteral, the parser uses peekAfterIfType to select |
30 between function expression and send. | 24 between function expression and send. |
31 | 25 |
32 * In parseVariablesDeclarationOrExpressionOpt, the parser uses | 26 * In parseVariablesDeclarationOrExpressionOpt, the parser uses |
33 peekIdentifierAfterType to select between local variable declarations or an | 27 peekIdentifierAfterType to select between local variable declarations or an |
34 expression. | 28 expression. |
35 | 29 |
36 * In parseSwitchCase, the parser uses peekPastLabels to select between case | 30 * In parseSwitchCase, the parser uses peekPastLabels to select between case |
37 labels and statement labels. | 31 labels and statement labels. |
38 | 32 |
39 * The parser uses isGeneralizedFunctionType in parseType, and findMemberName. | 33 * The parser uses isGeneralizedFunctionType in parseType, and findMemberName. |
40 | 34 |
41 * The parser uses findMemberName in parseTopLevelMember, and parseMember. | 35 * The parser uses findMemberName in parseTopLevelMember, and parseMember. |
OLD | NEW |