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

Side by Side Diff: pkg/front_end/lib/src/fasta/source/source_library_builder.dart

Issue 2899043006: cleanup fasta token classes (Closed)
Patch Set: Created 3 years, 6 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
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.source_library_builder; 5 library fasta.source_library_builder;
6 6
7 import 'package:front_end/src/scanner/token.dart' show Token; 7 import 'package:front_end/src/scanner/token.dart' show Token;
8 8
9 import 'package:front_end/src/fasta/scanner/token.dart' show SymbolToken;
10
11 import 'package:kernel/ast.dart' show ProcedureKind; 9 import 'package:kernel/ast.dart' show ProcedureKind;
12 10
13 import '../combinator.dart' show Combinator; 11 import '../combinator.dart' show Combinator;
14 12
15 import '../errors.dart' show inputError, internalError; 13 import '../errors.dart' show inputError, internalError;
16 14
17 import '../export.dart' show Export; 15 import '../export.dart' show Export;
18 16
19 import '../import.dart' show Import; 17 import '../import.dart' show Import;
20 18
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 for (int i = 0; i < namesOffsetsAndInitializers.length; i += 4) { 191 for (int i = 0; i < namesOffsetsAndInitializers.length; i += 4) {
194 String name = namesOffsetsAndInitializers[i]; 192 String name = namesOffsetsAndInitializers[i];
195 int charOffset = namesOffsetsAndInitializers[i + 1]; 193 int charOffset = namesOffsetsAndInitializers[i + 1];
196 Token initializer; 194 Token initializer;
197 if (type == null) { 195 if (type == null) {
198 initializer = namesOffsetsAndInitializers[i + 2]; 196 initializer = namesOffsetsAndInitializers[i + 2];
199 Token afterInitializer = namesOffsetsAndInitializers[i + 3]; 197 Token afterInitializer = namesOffsetsAndInitializers[i + 3];
200 // TODO(paulberry): figure out a way to do this without using 198 // TODO(paulberry): figure out a way to do this without using
201 // Token.previous. 199 // Token.previous.
202 afterInitializer?.previous 200 afterInitializer?.previous
203 ?.setNext(new SymbolToken.eof(afterInitializer.offset)); 201 ?.setNext(new Token.eof(afterInitializer.offset));
204 } 202 }
205 addField(metadata, modifiers, type, name, charOffset, initializer); 203 addField(metadata, modifiers, type, name, charOffset, initializer);
206 } 204 }
207 } 205 }
208 206
209 void addProcedure( 207 void addProcedure(
210 List<MetadataBuilder> metadata, 208 List<MetadataBuilder> metadata,
211 int modifiers, 209 int modifiers,
212 T returnType, 210 T returnType,
213 String name, 211 String name,
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 /// synthesize type variables on the factory matching the class'. 565 /// synthesize type variables on the factory matching the class'.
568 void addFactoryDeclaration( 566 void addFactoryDeclaration(
569 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) { 567 ProcedureBuilder procedure, DeclarationBuilder<T> factoryDeclaration) {
570 factoryDeclarations[procedure] = factoryDeclaration; 568 factoryDeclarations[procedure] = factoryDeclaration;
571 } 569 }
572 570
573 Scope toScope(Scope parent) { 571 Scope toScope(Scope parent) {
574 return new Scope(members, setters, parent, isModifiable: false); 572 return new Scope(members, setters, parent, isModifiable: false);
575 } 573 }
576 } 574 }
OLDNEW
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/diet_parser.dart ('k') | pkg/front_end/lib/src/fasta/source/stack_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698