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

Side by Side Diff: lib/compiler/implementation/tree/nodes.dart

Issue 11090016: Change core lib, dart2js, and more for new optional parameters syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 2 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 abstract class Visitor<R> { 5 abstract class Visitor<R> {
6 const Visitor(); 6 const Visitor();
7 7
8 abstract R visitNode(Node node); 8 abstract R visitNode(Node node);
9 9
10 R visitBlock(Block node) => visitStatement(node); 10 R visitBlock(Block node) => visitStatement(node);
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 Send selectorSend = selector; 350 Send selectorSend = selector;
351 if (selectorSend.receiver is TypeAnnotation) { 351 if (selectorSend.receiver is TypeAnnotation) {
352 return selectorSend.receiver; 352 return selectorSend.receiver;
353 } 353 }
354 } 354 }
355 return null; 355 return null;
356 } 356 }
357 } 357 }
358 358
359 class Postfix extends NodeList { 359 class Postfix extends NodeList {
360 Postfix() : super(nodes: const Link<Node>()); 360 Postfix() : super(null, const Link<Node>());
361 Postfix.singleton(Node argument) : super.singleton(argument); 361 Postfix.singleton(Node argument) : super.singleton(argument);
362 } 362 }
363 363
364 class Prefix extends NodeList { 364 class Prefix extends NodeList {
365 Prefix() : super(nodes: const Link<Node>()); 365 Prefix() : super(null, const Link<Node>());
366 Prefix.singleton(Node argument) : super.singleton(argument); 366 Prefix.singleton(Node argument) : super.singleton(argument);
367 } 367 }
368 368
369 class SendSet extends Send { 369 class SendSet extends Send {
370 final Operator assignmentOperator; 370 final Operator assignmentOperator;
371 SendSet(receiver, selector, this.assignmentOperator, argumentsNode) 371 SendSet(receiver, selector, this.assignmentOperator, argumentsNode)
372 : super(receiver, selector, argumentsNode); 372 : super(receiver, selector, argumentsNode);
373 SendSet.postfix(receiver, 373 SendSet.postfix(receiver,
374 selector, 374 selector,
375 this.assignmentOperator, 375 this.assignmentOperator,
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 MULTILINE_SQ, 797 MULTILINE_SQ,
798 RAW_MULTILINE_SQ, 798 RAW_MULTILINE_SQ,
799 MULTILINE_NL_SQ, 799 MULTILINE_NL_SQ,
800 RAW_MULTILINE_NL_SQ, 800 RAW_MULTILINE_NL_SQ,
801 MULTILINE_NL2_SQ, 801 MULTILINE_NL2_SQ,
802 RAW_MULTILINE_NL2_SQ 802 RAW_MULTILINE_NL2_SQ
803 ]; 803 ];
804 final bool raw; 804 final bool raw;
805 final int leftQuoteCharCount; 805 final int leftQuoteCharCount;
806 final int quote; 806 final int quote;
807 const StringQuoting(this.quote, [bool raw, int leftQuoteLength]) 807 const StringQuoting(this.quote, {bool raw, int leftQuoteLength})
808 : this.raw = raw, this.leftQuoteCharCount = leftQuoteLength; 808 : this.raw = raw, this.leftQuoteCharCount = leftQuoteLength;
809 String get quoteChar => quote === $DQ ? '"' : "'"; 809 String get quoteChar => quote === $DQ ? '"' : "'";
810 810
811 int get leftQuoteLength => (raw ? 1 : 0) + leftQuoteCharCount; 811 int get leftQuoteLength => (raw ? 1 : 0) + leftQuoteCharCount;
812 int get rightQuoteLength => (leftQuoteCharCount > 2) ? 3 : 1; 812 int get rightQuoteLength => (leftQuoteCharCount > 2) ? 3 : 1;
813 static StringQuoting getQuoting(int quote, bool raw, int quoteLength) { 813 static StringQuoting getQuoting(int quote, bool raw, int quoteLength) {
814 int index = quoteLength - 1; 814 int index = quoteLength - 1;
815 if (quoteLength > 2) index -= 1; 815 if (quoteLength > 2) index -= 1;
816 return mapping[(raw ? 1 : 0) + index * 2 + (quote === $SQ ? 8 : 0)]; 816 return mapping[(raw ? 1 : 0) + index * 2 + (quote === $SQ ? 8 : 0)];
817 } 817 }
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2017 * argument). 2017 * argument).
2018 * 2018 *
2019 * TODO(ahe): This method is controversial, the team needs to discuss 2019 * TODO(ahe): This method is controversial, the team needs to discuss
2020 * if top-level methods are acceptable and what naming conventions to 2020 * if top-level methods are acceptable and what naming conventions to
2021 * use. 2021 * use.
2022 */ 2022 */
2023 initializerDo(Node node, f(Node node)) { 2023 initializerDo(Node node, f(Node node)) {
2024 SendSet send = node.asSendSet(); 2024 SendSet send = node.asSendSet();
2025 if (send !== null) return f(send.arguments.head); 2025 if (send !== null) return f(send.arguments.head);
2026 } 2026 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/tools/mini_parser.dart ('k') | lib/compiler/implementation/tree/unparser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698