OLD | NEW |
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.outline_builder; | 5 library fasta.outline_builder; |
6 | 6 |
7 import 'package:kernel/ast.dart' show | 7 import 'package:kernel/ast.dart' show AsyncMarker, ProcedureKind; |
8 AsyncMarker, | |
9 ProcedureKind; | |
10 | 8 |
11 import '../parser/parser.dart' show | 9 import '../parser/parser.dart' show FormalParameterType, optional; |
12 FormalParameterType, | |
13 optional; | |
14 | 10 |
15 import '../scanner/token.dart' show | 11 import '../scanner/token.dart' show Token; |
16 Token; | |
17 | 12 |
18 import '../util/link.dart' show | 13 import '../util/link.dart' show Link; |
19 Link; | |
20 | 14 |
21 import '../combinator.dart' show | 15 import '../combinator.dart' show Combinator; |
22 Combinator; | |
23 | 16 |
24 import '../errors.dart' show | 17 import '../errors.dart' show internalError; |
25 internalError; | |
26 | 18 |
27 import '../builder/builder.dart'; | 19 import '../builder/builder.dart'; |
28 | 20 |
29 import '../modifier.dart' show | 21 import '../modifier.dart' show Modifier; |
30 Modifier; | |
31 | 22 |
32 import 'source_library_builder.dart' show | 23 import 'source_library_builder.dart' show SourceLibraryBuilder; |
33 SourceLibraryBuilder; | |
34 | 24 |
35 import 'unhandled_listener.dart' show | 25 import 'unhandled_listener.dart' show NullValue, Unhandled, UnhandledListener; |
36 NullValue, | |
37 Unhandled, | |
38 UnhandledListener; | |
39 | 26 |
40 import '../parser/error_kind.dart' show | 27 import '../parser/error_kind.dart' show ErrorKind; |
41 ErrorKind; | |
42 | 28 |
43 import '../parser/dart_vm_native.dart' show | 29 import '../parser/dart_vm_native.dart' |
44 removeNativeClause, | 30 show removeNativeClause, skipNativeClause; |
45 skipNativeClause; | |
46 | 31 |
47 import '../operator.dart' show | 32 import '../operator.dart' show Operator, operatorFromString, operatorToString; |
48 Operator, | |
49 operatorFromString, | |
50 operatorToString; | |
51 | 33 |
52 import '../quote.dart' show | 34 import '../quote.dart' show unescapeString; |
53 unescapeString; | |
54 | 35 |
55 enum MethodBody { | 36 enum MethodBody { |
56 Abstract, | 37 Abstract, |
57 Regular, | 38 Regular, |
58 RedirectingFactoryBody, | 39 RedirectingFactoryBody, |
59 } | 40 } |
60 | 41 |
61 AsyncMarker asyncMarkerFromTokens(Token asyncToken, Token starToken) { | 42 AsyncMarker asyncMarkerFromTokens(Token asyncToken, Token starToken) { |
62 if (asyncToken == null || identical(asyncToken.stringValue, "sync")) { | 43 if (asyncToken == null || identical(asyncToken.stringValue, "sync")) { |
63 if (starToken == null) { | 44 if (starToken == null) { |
64 return AsyncMarker.Sync; | 45 return AsyncMarker.Sync; |
65 } else { | 46 } else { |
66 assert(identical(starToken.stringValue, "*")); | 47 assert(identical(starToken.stringValue, "*")); |
67 return AsyncMarker.SyncStar; | 48 return AsyncMarker.SyncStar; |
68 } | 49 } |
69 } else if (identical(asyncToken.stringValue, "async")) { | 50 } else if (identical(asyncToken.stringValue, "async")) { |
70 if (starToken == null) { | 51 if (starToken == null) { |
71 return AsyncMarker.Async; | 52 return AsyncMarker.Async; |
72 } else { | 53 } else { |
73 assert(identical(starToken.stringValue, "*")); | 54 assert(identical(starToken.stringValue, "*")); |
74 return AsyncMarker.AsyncStar; | 55 return AsyncMarker.AsyncStar; |
75 } | 56 } |
76 } else { | 57 } else { |
77 return internalError("Unknown async modifier: $asyncToken"); | 58 return internalError("Unknown async modifier: $asyncToken"); |
78 } | 59 } |
79 } | 60 } |
(...skipping 13 matching lines...) Expand all Loading... |
93 Uri get uri => library.fileUri; | 74 Uri get uri => library.fileUri; |
94 | 75 |
95 @override | 76 @override |
96 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { | 77 void endMetadata(Token beginToken, Token periodBeforeName, Token endToken) { |
97 debugEvent("Metadata"); | 78 debugEvent("Metadata"); |
98 List arguments = pop(); | 79 List arguments = pop(); |
99 String postfix = popIfNotNull(periodBeforeName); | 80 String postfix = popIfNotNull(periodBeforeName); |
100 List<TypeBuilder> typeArguments = pop(); | 81 List<TypeBuilder> typeArguments = pop(); |
101 if (arguments == null) { | 82 if (arguments == null) { |
102 String expression = pop(); | 83 String expression = pop(); |
103 push(new MetadataBuilder.fromExpression(expression, postfix, library, | 84 push(new MetadataBuilder.fromExpression( |
104 beginToken.charOffset)); | 85 expression, postfix, library, beginToken.charOffset)); |
105 } else { | 86 } else { |
106 String typeName = pop(); | 87 String typeName = pop(); |
107 push(new MetadataBuilder.fromConstructor( | 88 push(new MetadataBuilder.fromConstructor( |
108 library.addConstructorReference( | 89 library.addConstructorReference( |
109 typeName, typeArguments, postfix, | 90 typeName, typeArguments, postfix, beginToken.next.charOffset), |
110 beginToken.next.charOffset), | 91 arguments, |
111 arguments, library, beginToken.charOffset)); | 92 library, |
| 93 beginToken.charOffset)); |
112 } | 94 } |
113 } | 95 } |
114 | 96 |
115 @override | 97 @override |
116 void endHide(Token hideKeyword) { | 98 void endHide(Token hideKeyword) { |
117 debugEvent("Hide"); | 99 debugEvent("Hide"); |
118 List<String> names = pop(); | 100 List<String> names = pop(); |
119 push(new Combinator.hide(names, hideKeyword.charOffset, library.fileUri)); | 101 push(new Combinator.hide(names, hideKeyword.charOffset, library.fileUri)); |
120 } | 102 } |
121 | 103 |
(...skipping 24 matching lines...) Expand all Loading... |
146 | 128 |
147 @override | 129 @override |
148 void endImport(Token importKeyword, Token deferredKeyword, Token asKeyword, | 130 void endImport(Token importKeyword, Token deferredKeyword, Token asKeyword, |
149 Token semicolon) { | 131 Token semicolon) { |
150 debugEvent("endImport"); | 132 debugEvent("endImport"); |
151 List<Combinator> combinators = pop(); | 133 List<Combinator> combinators = pop(); |
152 String prefix = popIfNotNull(asKeyword); | 134 String prefix = popIfNotNull(asKeyword); |
153 Unhandled conditionalUris = pop(); | 135 Unhandled conditionalUris = pop(); |
154 String uri = pop(); | 136 String uri = pop(); |
155 List<MetadataBuilder> metadata = pop(); | 137 List<MetadataBuilder> metadata = pop(); |
156 library.addImport(metadata, uri, conditionalUris, prefix, combinators, | 138 library.addImport( |
157 deferredKeyword != null, importKeyword.charOffset, | 139 metadata, |
| 140 uri, |
| 141 conditionalUris, |
| 142 prefix, |
| 143 combinators, |
| 144 deferredKeyword != null, |
| 145 importKeyword.charOffset, |
158 asKeyword?.next?.charOffset ?? -1); | 146 asKeyword?.next?.charOffset ?? -1); |
159 checkEmpty(importKeyword.charOffset); | 147 checkEmpty(importKeyword.charOffset); |
160 } | 148 } |
161 | 149 |
162 @override | 150 @override |
163 void endPart(Token partKeyword, Token semicolon) { | 151 void endPart(Token partKeyword, Token semicolon) { |
164 debugEvent("Part"); | 152 debugEvent("Part"); |
165 String uri = pop(); | 153 String uri = pop(); |
166 List<MetadataBuilder> metadata = pop(); | 154 List<MetadataBuilder> metadata = pop(); |
167 library.addPart(metadata, uri); | 155 library.addPart(metadata, uri); |
(...skipping 28 matching lines...) Expand all Loading... |
196 library.name = name; | 184 library.name = name; |
197 library.metadata = metadata; | 185 library.metadata = metadata; |
198 } | 186 } |
199 | 187 |
200 @override | 188 @override |
201 void beginClassDeclaration(Token begin, Token name) { | 189 void beginClassDeclaration(Token begin, Token name) { |
202 library.beginNestedDeclaration(name.value); | 190 library.beginNestedDeclaration(name.value); |
203 } | 191 } |
204 | 192 |
205 @override | 193 @override |
206 void endClassDeclaration(int interfacesCount, Token beginToken, | 194 void endClassDeclaration( |
207 Token classKeyword, Token extendsKeyword, Token implementsKeyword, | 195 int interfacesCount, |
| 196 Token beginToken, |
| 197 Token classKeyword, |
| 198 Token extendsKeyword, |
| 199 Token implementsKeyword, |
208 Token endToken) { | 200 Token endToken) { |
209 debugEvent("endClassDeclaration"); | 201 debugEvent("endClassDeclaration"); |
210 List<TypeBuilder> interfaces = popList(interfacesCount); | 202 List<TypeBuilder> interfaces = popList(interfacesCount); |
211 TypeBuilder supertype = pop(); | 203 TypeBuilder supertype = pop(); |
212 List<TypeVariableBuilder> typeVariables = pop(); | 204 List<TypeVariableBuilder> typeVariables = pop(); |
213 String name = pop(); | 205 String name = pop(); |
214 if (typeVariables != null && supertype is MixinApplicationBuilder) { | 206 if (typeVariables != null && supertype is MixinApplicationBuilder) { |
215 supertype.typeVariables = typeVariables; | 207 supertype.typeVariables = typeVariables; |
216 supertype.subclassName = name; | 208 supertype.subclassName = name; |
217 } | 209 } |
(...skipping 10 matching lines...) Expand all Loading... |
228 if (optional("set", token)) return ProcedureKind.Setter; | 220 if (optional("set", token)) return ProcedureKind.Setter; |
229 return internalError("Unhandled: ${token.value}"); | 221 return internalError("Unhandled: ${token.value}"); |
230 } | 222 } |
231 | 223 |
232 @override | 224 @override |
233 void beginTopLevelMethod(Token token, Token name) { | 225 void beginTopLevelMethod(Token token, Token name) { |
234 library.beginNestedDeclaration(name.value, hasMembers: false); | 226 library.beginNestedDeclaration(name.value, hasMembers: false); |
235 } | 227 } |
236 | 228 |
237 @override | 229 @override |
238 void endTopLevelMethod( | 230 void endTopLevelMethod(Token beginToken, Token getOrSet, Token endToken) { |
239 Token beginToken, Token getOrSet, Token endToken) { | |
240 debugEvent("endTopLevelMethod"); | 231 debugEvent("endTopLevelMethod"); |
241 MethodBody kind = pop(); | 232 MethodBody kind = pop(); |
242 AsyncMarker asyncModifier = pop(); | 233 AsyncMarker asyncModifier = pop(); |
243 List<FormalParameterBuilder> formals = pop(); | 234 List<FormalParameterBuilder> formals = pop(); |
244 List<TypeVariableBuilder> typeVariables = pop(); | 235 List<TypeVariableBuilder> typeVariables = pop(); |
245 String name = pop(); | 236 String name = pop(); |
246 TypeBuilder returnType = pop(); | 237 TypeBuilder returnType = pop(); |
247 int modifiers = Modifier.validate(pop(), | 238 int modifiers = |
248 isAbstract: kind == MethodBody.Abstract); | 239 Modifier.validate(pop(), isAbstract: kind == MethodBody.Abstract); |
249 List<MetadataBuilder> metadata = pop(); | 240 List<MetadataBuilder> metadata = pop(); |
250 checkEmpty(beginToken.charOffset); | 241 checkEmpty(beginToken.charOffset); |
251 library.addProcedure(metadata, modifiers, returnType, name, | 242 library.addProcedure( |
252 typeVariables, formals, asyncModifier, computeProcedureKind(getOrSet), | 243 metadata, |
253 beginToken.charOffset, nativeMethodName, isTopLevel: true); | 244 modifiers, |
| 245 returnType, |
| 246 name, |
| 247 typeVariables, |
| 248 formals, |
| 249 asyncModifier, |
| 250 computeProcedureKind(getOrSet), |
| 251 beginToken.charOffset, |
| 252 nativeMethodName, |
| 253 isTopLevel: true); |
254 nativeMethodName = null; | 254 nativeMethodName = null; |
255 } | 255 } |
256 | 256 |
257 @override | 257 @override |
258 void handleNoFunctionBody(Token token) { | 258 void handleNoFunctionBody(Token token) { |
259 debugEvent("NoFunctionBody"); | 259 debugEvent("NoFunctionBody"); |
260 push(MethodBody.Abstract); | 260 push(MethodBody.Abstract); |
261 } | 261 } |
262 | 262 |
263 @override | 263 @override |
(...skipping 25 matching lines...) Expand all Loading... |
289 String name; | 289 String name; |
290 ProcedureKind kind; | 290 ProcedureKind kind; |
291 if (nameOrOperator is Operator) { | 291 if (nameOrOperator is Operator) { |
292 name = operatorToString(nameOrOperator); | 292 name = operatorToString(nameOrOperator); |
293 kind = ProcedureKind.Operator; | 293 kind = ProcedureKind.Operator; |
294 } else { | 294 } else { |
295 name = nameOrOperator; | 295 name = nameOrOperator; |
296 kind = computeProcedureKind(getOrSet); | 296 kind = computeProcedureKind(getOrSet); |
297 } | 297 } |
298 TypeBuilder returnType = pop(); | 298 TypeBuilder returnType = pop(); |
299 int modifiers = Modifier.validate(pop(), | 299 int modifiers = |
300 isAbstract: bodyKind == MethodBody.Abstract); | 300 Modifier.validate(pop(), isAbstract: bodyKind == MethodBody.Abstract); |
301 List<MetadataBuilder> metadata = pop(); | 301 List<MetadataBuilder> metadata = pop(); |
302 library.addProcedure(metadata, modifiers, returnType, name, typeVariables, | 302 library.addProcedure(metadata, modifiers, returnType, name, typeVariables, |
303 formals, asyncModifier, kind, beginToken.charOffset, nativeMethodName, | 303 formals, asyncModifier, kind, beginToken.charOffset, nativeMethodName, |
304 isTopLevel: false); | 304 isTopLevel: false); |
305 nativeMethodName = null; | 305 nativeMethodName = null; |
306 } | 306 } |
307 | 307 |
308 @override | 308 @override |
309 void endMixinApplication() { | 309 void endMixinApplication() { |
310 debugEvent("MixinApplication"); | 310 debugEvent("MixinApplication"); |
311 List<TypeBuilder> mixins = pop(); | 311 List<TypeBuilder> mixins = pop(); |
312 TypeBuilder supertype = pop(); | 312 TypeBuilder supertype = pop(); |
313 push(library.addMixinApplication(supertype, mixins, -1)); | 313 push(library.addMixinApplication(supertype, mixins, -1)); |
314 } | 314 } |
315 | 315 |
316 @override | 316 @override |
317 void beginNamedMixinApplication(Token begin, Token name) { | 317 void beginNamedMixinApplication(Token begin, Token name) { |
318 library.beginNestedDeclaration(name.value, hasMembers: false); | 318 library.beginNestedDeclaration(name.value, hasMembers: false); |
319 } | 319 } |
320 | 320 |
321 @override | 321 @override |
322 void endNamedMixinApplication( | 322 void endNamedMixinApplication(Token beginToken, Token classKeyword, |
323 Token beginToken, Token classKeyword, Token equals, | 323 Token equals, Token implementsKeyword, Token endToken) { |
324 Token implementsKeyword, Token endToken) { | |
325 debugEvent("endNamedMixinApplication"); | 324 debugEvent("endNamedMixinApplication"); |
326 List<TypeBuilder> interfaces = popIfNotNull(implementsKeyword); | 325 List<TypeBuilder> interfaces = popIfNotNull(implementsKeyword); |
327 TypeBuilder mixinApplication = pop(); | 326 TypeBuilder mixinApplication = pop(); |
328 List<TypeVariableBuilder> typeVariables = pop(); | 327 List<TypeVariableBuilder> typeVariables = pop(); |
329 String name = pop(); | 328 String name = pop(); |
330 if (typeVariables != null && mixinApplication is MixinApplicationBuilder) { | 329 if (typeVariables != null && mixinApplication is MixinApplicationBuilder) { |
331 mixinApplication.typeVariables = typeVariables; | 330 mixinApplication.typeVariables = typeVariables; |
332 mixinApplication.subclassName = name; | 331 mixinApplication.subclassName = name; |
333 } | 332 } |
334 int modifiers = Modifier.validate(pop()); | 333 int modifiers = Modifier.validate(pop()); |
335 List<MetadataBuilder> metadata = pop(); | 334 List<MetadataBuilder> metadata = pop(); |
336 library.addNamedMixinApplication( | 335 library.addNamedMixinApplication(metadata, name, typeVariables, modifiers, |
337 metadata, name, typeVariables, modifiers, mixinApplication, interfaces, | 336 mixinApplication, interfaces, beginToken.charOffset); |
338 beginToken.charOffset); | |
339 checkEmpty(beginToken.charOffset); | 337 checkEmpty(beginToken.charOffset); |
340 } | 338 } |
341 | 339 |
342 @override | 340 @override |
343 void endTypeArguments(int count, Token beginToken, Token endToken) { | 341 void endTypeArguments(int count, Token beginToken, Token endToken) { |
344 debugEvent("TypeArguments"); | 342 debugEvent("TypeArguments"); |
345 push(popList(count) ?? NullValue.TypeArguments); | 343 push(popList(count) ?? NullValue.TypeArguments); |
346 } | 344 } |
347 | 345 |
348 @override | 346 @override |
(...skipping 16 matching lines...) Expand all Loading... |
365 push(popList(count) ?? NullValue.TypeVariables); | 363 push(popList(count) ?? NullValue.TypeVariables); |
366 } | 364 } |
367 | 365 |
368 @override | 366 @override |
369 void handleVoidKeyword(Token token) { | 367 void handleVoidKeyword(Token token) { |
370 debugEvent("VoidKeyword"); | 368 debugEvent("VoidKeyword"); |
371 push(library.addVoidType(token.charOffset)); | 369 push(library.addVoidType(token.charOffset)); |
372 } | 370 } |
373 | 371 |
374 @override | 372 @override |
375 void endFormalParameter(Token covariantKeyword, Token thisKeyword, | 373 void endFormalParameter( |
376 FormalParameterType kind) { | 374 Token covariantKeyword, Token thisKeyword, FormalParameterType kind) { |
377 debugEvent("FormalParameter"); | 375 debugEvent("FormalParameter"); |
378 String name = pop(); | 376 String name = pop(); |
379 TypeBuilder type = pop(); | 377 TypeBuilder type = pop(); |
380 int modifiers = Modifier.validate(pop()); | 378 int modifiers = Modifier.validate(pop()); |
381 List<MetadataBuilder> metadata = pop(); | 379 List<MetadataBuilder> metadata = pop(); |
382 // TODO(ahe): Needs begin token. | 380 // TODO(ahe): Needs begin token. |
383 push(library.addFormalParameter(metadata, modifiers, type, name, | 381 push(library.addFormalParameter(metadata, modifiers, type, name, |
384 thisKeyword != null, thisKeyword?.charOffset ?? -1)); | 382 thisKeyword != null, thisKeyword?.charOffset ?? -1)); |
385 } | 383 } |
386 | 384 |
387 @override | 385 @override |
388 void handleValuedFormalParameter(Token equals, Token token) { | 386 void handleValuedFormalParameter(Token equals, Token token) { |
389 debugEvent("ValuedFormalParameter"); | 387 debugEvent("ValuedFormalParameter"); |
390 // Ignored for now. | 388 // Ignored for now. |
391 } | 389 } |
392 | 390 |
393 @override | 391 @override |
394 void handleFormalParameterWithoutValue(Token token) { | 392 void handleFormalParameterWithoutValue(Token token) { |
395 debugEvent("FormalParameterWithoutValue"); | 393 debugEvent("FormalParameterWithoutValue"); |
396 // Ignored for now. | 394 // Ignored for now. |
397 } | 395 } |
398 | 396 |
399 @override | 397 @override |
400 void endFunctionTypedFormalParameter(Token covariantKeyword, | 398 void endFunctionTypedFormalParameter( |
401 Token thisKeyword, FormalParameterType kind) { | 399 Token covariantKeyword, Token thisKeyword, FormalParameterType kind) { |
402 debugEvent("FunctionTypedFormalParameter"); | 400 debugEvent("FunctionTypedFormalParameter"); |
403 pop(); // Function type parameters. | 401 pop(); // Function type parameters. |
404 pop(); // Type variables. | 402 pop(); // Type variables. |
405 String name = pop(); | 403 String name = pop(); |
406 pop(); // Return type. | 404 pop(); // Return type. |
407 push(NullValue.Type); | 405 push(NullValue.Type); |
408 push(name); | 406 push(name); |
409 } | 407 } |
410 | 408 |
411 @override | 409 @override |
412 void endOptionalFormalParameters( | 410 void endOptionalFormalParameters( |
413 int count, Token beginToken, Token endToken) { | 411 int count, Token beginToken, Token endToken) { |
414 debugEvent("OptionalFormalParameters"); | 412 debugEvent("OptionalFormalParameters"); |
415 FormalParameterType kind = optional("{", beginToken) | 413 FormalParameterType kind = optional("{", beginToken) |
416 ? FormalParameterType.NAMED : FormalParameterType.POSITIONAL; | 414 ? FormalParameterType.NAMED |
| 415 : FormalParameterType.POSITIONAL; |
417 List parameters = popList(count); | 416 List parameters = popList(count); |
418 for (FormalParameterBuilder parameter in parameters) { | 417 for (FormalParameterBuilder parameter in parameters) { |
419 parameter.kind = kind; | 418 parameter.kind = kind; |
420 } | 419 } |
421 push(parameters); | 420 push(parameters); |
422 } | 421 } |
423 | 422 |
424 @override | 423 @override |
425 void endFormalParameters(int count, Token beginToken, Token endToken) { | 424 void endFormalParameters(int count, Token beginToken, Token endToken) { |
426 debugEvent("FormalParameters"); | 425 debugEvent("FormalParameters"); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 | 467 |
469 @override | 468 @override |
470 void endFunctionTypeAlias( | 469 void endFunctionTypeAlias( |
471 Token typedefKeyword, Token equals, Token endToken) { | 470 Token typedefKeyword, Token equals, Token endToken) { |
472 debugEvent("endFunctionTypeAlias"); | 471 debugEvent("endFunctionTypeAlias"); |
473 List<FormalParameterBuilder> formals = pop(); | 472 List<FormalParameterBuilder> formals = pop(); |
474 List<TypeVariableBuilder> typeVariables = pop(); | 473 List<TypeVariableBuilder> typeVariables = pop(); |
475 String name = pop(); | 474 String name = pop(); |
476 TypeBuilder returnType = pop(); | 475 TypeBuilder returnType = pop(); |
477 List<MetadataBuilder> metadata = pop(); | 476 List<MetadataBuilder> metadata = pop(); |
478 library.addFunctionTypeAlias( | 477 library.addFunctionTypeAlias(metadata, returnType, name, typeVariables, |
479 metadata, returnType, name, typeVariables, formals, | 478 formals, typedefKeyword.charOffset); |
480 typedefKeyword.charOffset); | |
481 checkEmpty(typedefKeyword.charOffset); | 479 checkEmpty(typedefKeyword.charOffset); |
482 } | 480 } |
483 | 481 |
484 @override | 482 @override |
485 void endTopLevelFields(int count, Token beginToken, Token endToken) { | 483 void endTopLevelFields(int count, Token beginToken, Token endToken) { |
486 debugEvent("endTopLevelFields"); | 484 debugEvent("endTopLevelFields"); |
487 List<String> names = popList(count); | 485 List<String> names = popList(count); |
488 TypeBuilder type = pop(); | 486 TypeBuilder type = pop(); |
489 int modifiers = Modifier.validate(pop()); | 487 int modifiers = Modifier.validate(pop()); |
490 List<MetadataBuilder> metadata = pop(); | 488 List<MetadataBuilder> metadata = pop(); |
(...skipping 28 matching lines...) Expand all Loading... |
519 } | 517 } |
520 | 518 |
521 @override | 519 @override |
522 void endConstructorReference( | 520 void endConstructorReference( |
523 Token start, Token periodBeforeName, Token endToken) { | 521 Token start, Token periodBeforeName, Token endToken) { |
524 debugEvent("ConstructorReference"); | 522 debugEvent("ConstructorReference"); |
525 String suffix = popIfNotNull(periodBeforeName); | 523 String suffix = popIfNotNull(periodBeforeName); |
526 List<TypeBuilder> typeArguments = pop(); | 524 List<TypeBuilder> typeArguments = pop(); |
527 String name = pop(); | 525 String name = pop(); |
528 push(library.addConstructorReference( | 526 push(library.addConstructorReference( |
529 name, typeArguments, suffix, start.charOffset)); | 527 name, typeArguments, suffix, start.charOffset)); |
530 } | 528 } |
531 | 529 |
532 @override | 530 @override |
533 void beginFactoryMethod(Token token) { | 531 void beginFactoryMethod(Token token) { |
534 library.beginNestedDeclaration(null, hasMembers: false); | 532 library.beginNestedDeclaration(null, hasMembers: false); |
535 } | 533 } |
536 | 534 |
537 @override | 535 @override |
538 void endFactoryMethod(Token beginToken, Token endToken) { | 536 void endFactoryMethod(Token beginToken, Token endToken) { |
539 debugEvent("FactoryMethod"); | 537 debugEvent("FactoryMethod"); |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 Link<Token> handleMemberName(Link<Token> identifiers) { | 623 Link<Token> handleMemberName(Link<Token> identifiers) { |
626 if (!isDartLibrary || identifiers.isEmpty) return identifiers; | 624 if (!isDartLibrary || identifiers.isEmpty) return identifiers; |
627 return removeNativeClause(identifiers); | 625 return removeNativeClause(identifiers); |
628 } | 626 } |
629 | 627 |
630 @override | 628 @override |
631 void debugEvent(String name) { | 629 void debugEvent(String name) { |
632 // printEvent(name); | 630 // printEvent(name); |
633 } | 631 } |
634 } | 632 } |
OLD | NEW |