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

Side by Side Diff: pkg/analyzer/lib/src/fasta/ast_builder.dart

Issue 2802693004: Handle const list and map literals. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 fasta.analyzer.ast_builder; 5 library fasta.analyzer.ast_builder;
6 6
7 import 'package:analyzer/analyzer.dart'; 7 import 'package:analyzer/analyzer.dart';
8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory; 8 import 'package:analyzer/dart/ast/ast_factory.dart' show AstFactory;
9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard; 9 import 'package:analyzer/dart/ast/standard_ast_factory.dart' as standard;
10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token; 10 import 'package:analyzer/dart/ast/token.dart' as analyzer show Token;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 push(ast.constructorName(ast.typeName(typeNameIdentifier, typeArguments), 89 push(ast.constructorName(ast.typeName(typeNameIdentifier, typeArguments),
90 toAnalyzerToken(periodBeforeName), constructorName)); 90 toAnalyzerToken(periodBeforeName), constructorName));
91 } 91 }
92 92
93 @override 93 @override
94 void endConstExpression(Token token) { 94 void endConstExpression(Token token) {
95 debugEvent("ConstExpression"); 95 debugEvent("ConstExpression");
96 _handleInstanceCreation(token); 96 _handleInstanceCreation(token);
97 } 97 }
98 98
99 @override
100 void endConstLiteral(Token token) {
101 debugEvent("endConstLiteral");
102 }
103
99 void _handleInstanceCreation(Token token) { 104 void _handleInstanceCreation(Token token) {
100 MethodInvocation arguments = pop(); 105 MethodInvocation arguments = pop();
101 ConstructorName constructorName = pop(); 106 ConstructorName constructorName = pop();
102 push(ast.instanceCreationExpression( 107 push(ast.instanceCreationExpression(
103 toAnalyzerToken(token), constructorName, arguments.argumentList)); 108 toAnalyzerToken(token), constructorName, arguments.argumentList));
104 } 109 }
105 110
106 @override 111 @override
107 void endNewExpression(Token token) { 112 void endNewExpression(Token token) {
108 debugEvent("NewExpression"); 113 debugEvent("NewExpression");
(...skipping 1851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1960 } else if (identical('static', s)) { 1965 } else if (identical('static', s)) {
1961 staticKeyword = token; 1966 staticKeyword = token;
1962 } else if (identical('var', s)) { 1967 } else if (identical('var', s)) {
1963 finalConstOrVarKeyword = token; 1968 finalConstOrVarKeyword = token;
1964 } else { 1969 } else {
1965 internalError('Unhandled modifier: $s'); 1970 internalError('Unhandled modifier: $s');
1966 } 1971 }
1967 } 1972 }
1968 } 1973 }
1969 } 1974 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/body_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698