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 |
8 AsyncMarker, | 8 AsyncMarker, |
9 ProcedureKind; | 9 ProcedureKind; |
10 | 10 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
345 List parameters = popList(count); | 345 List parameters = popList(count); |
346 for (FormalParameterBuilder parameter in parameters) { | 346 for (FormalParameterBuilder parameter in parameters) { |
347 parameter.kind = kind; | 347 parameter.kind = kind; |
348 } | 348 } |
349 push(parameters); | 349 push(parameters); |
350 } | 350 } |
351 | 351 |
352 @override | 352 @override |
353 void endFormalParameters(int count, Token beginToken, Token endToken) { | 353 void endFormalParameters(int count, Token beginToken, Token endToken) { |
354 debugEvent("FormalParameters"); | 354 debugEvent("FormalParameters"); |
355 // TODO(sigmund, ahe): to make strong clean we can either cast every value | |
356 // below, or split this list in 2, and simply ensure that we always have a | |
357 // list for optional arguments (empty or null there are none): | |
358 // List<FormalParameterBuilder> optionalFormals = pop(); | |
359 // List<FormalParameterBuilder> requiredFormals = popList(count); | |
355 List formals = popList(count); | 360 List formals = popList(count); |
356 if (formals != null && formals.isNotEmpty) { | 361 if (formals != null && formals.isNotEmpty) { |
357 var last = formals.last; | 362 var last = formals.last; |
358 if (last is List) { | 363 if (last is List) { |
364 List<FormalParameterBuilder> l = last; | |
Siggi Cherem (dart-lang)
2017/02/02 04:26:58
I don't want to submit this, this was just a test
| |
365 List<FormalParameterBuilder> f = formals.sublist(0, formals.length - 1); | |
359 var newList = | 366 var newList = |
360 new List<FormalParameterBuilder>(formals.length - 1 + last.length); | 367 new List<FormalParameterBuilder>(formals.length - 1 + last.length); |
361 newList.setRange(0, formals.length - 1, formals); | 368 newList.setRange(0, formals.length - 1, f); |
362 newList.setRange(formals.length - 1, newList.length, last); | 369 newList.setRange(formals.length - 1, newList.length, l); |
363 for (int i = 0; i < last.length; i++) { | 370 for (int i = 0; i < last.length; i++) { |
364 newList[i + formals.length - 1] = last[i]; | 371 newList[i + formals.length - 1] = last[i]; |
365 } | 372 } |
366 formals = newList; | 373 formals = newList; |
367 } | 374 } |
368 } | 375 } |
369 if (formals != null) { | 376 if (formals != null) { |
370 for (var formal in formals) { | 377 for (var formal in formals) { |
371 if (formal is! FormalParameterBuilder) { | 378 if (formal is! FormalParameterBuilder) { |
372 internalError(formals); | 379 internalError(formals); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
522 void handleModifiers(int count) { | 529 void handleModifiers(int count) { |
523 debugEvent("Modifiers"); | 530 debugEvent("Modifiers"); |
524 push(popList(count) ?? NullValue.Modifiers); | 531 push(popList(count) ?? NullValue.Modifiers); |
525 } | 532 } |
526 | 533 |
527 @override | 534 @override |
528 void debugEvent(String name) { | 535 void debugEvent(String name) { |
529 // printEvent(name); | 536 // printEvent(name); |
530 } | 537 } |
531 } | 538 } |
OLD | NEW |