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

Side by Side Diff: pkg/analyzer_experimental/test/generated/ast_test.dart

Issue 18129004: Simplify constructors translation, improve code style. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 // This code was auto-generated, is not intended to be edited, and is subject to 1 // This code was auto-generated, is not intended to be edited, and is subject to
2 // significant change. Please see the README file for more information. 2 // significant change. Please see the README file for more information.
3 library engine.ast_test; 3 library engine.ast_test;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'package:analyzer_experimental/src/generated/java_core.dart'; 5 import 'package:analyzer_experimental/src/generated/java_core.dart';
6 import 'package:analyzer_experimental/src/generated/java_engine.dart'; 6 import 'package:analyzer_experimental/src/generated/java_engine.dart';
7 import 'package:analyzer_experimental/src/generated/java_junit.dart'; 7 import 'package:analyzer_experimental/src/generated/java_junit.dart';
8 import 'package:analyzer_experimental/src/generated/source.dart'; 8 import 'package:analyzer_experimental/src/generated/source.dart';
9 import 'package:analyzer_experimental/src/generated/error.dart'; 9 import 'package:analyzer_experimental/src/generated/error.dart';
10 import 'package:analyzer_experimental/src/generated/scanner.dart'; 10 import 'package:analyzer_experimental/src/generated/scanner.dart';
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 static final AssignmentKind SIMPLE_LEFT = new AssignmentKind('SIMPLE_LEFT', 7) ; 707 static final AssignmentKind SIMPLE_LEFT = new AssignmentKind('SIMPLE_LEFT', 7) ;
708 static final AssignmentKind SIMPLE_RIGHT = new AssignmentKind('SIMPLE_RIGHT', 8); 708 static final AssignmentKind SIMPLE_RIGHT = new AssignmentKind('SIMPLE_RIGHT', 8);
709 static final AssignmentKind NONE = new AssignmentKind('NONE', 9); 709 static final AssignmentKind NONE = new AssignmentKind('NONE', 9);
710 static final List<AssignmentKind> values = [BINARY, COMPOUND_LEFT, COMPOUND_RI GHT, POSTFIX_INC, PREFIX_DEC, PREFIX_INC, PREFIX_NOT, SIMPLE_LEFT, SIMPLE_RIGHT, NONE]; 710 static final List<AssignmentKind> values = [BINARY, COMPOUND_LEFT, COMPOUND_RI GHT, POSTFIX_INC, PREFIX_DEC, PREFIX_INC, PREFIX_NOT, SIMPLE_LEFT, SIMPLE_RIGHT, NONE];
711 711
712 /// The name of this enum constant, as declared in the enum declaration. 712 /// The name of this enum constant, as declared in the enum declaration.
713 final String name; 713 final String name;
714 714
715 /// The position in the enum declaration. 715 /// The position in the enum declaration.
716 final int ordinal; 716 final int ordinal;
717 AssignmentKind(this.name, this.ordinal) { 717 AssignmentKind(this.name, this.ordinal);
718 }
719 int compareTo(AssignmentKind other) => ordinal - other.ordinal; 718 int compareTo(AssignmentKind other) => ordinal - other.ordinal;
720 int get hashCode => ordinal; 719 int get hashCode => ordinal;
721 String toString() => name; 720 String toString() => name;
722 } 721 }
723 class WrapperKind implements Comparable<WrapperKind> { 722 class WrapperKind implements Comparable<WrapperKind> {
724 static final WrapperKind PREFIXED_LEFT = new WrapperKind('PREFIXED_LEFT', 0); 723 static final WrapperKind PREFIXED_LEFT = new WrapperKind('PREFIXED_LEFT', 0);
725 static final WrapperKind PREFIXED_RIGHT = new WrapperKind('PREFIXED_RIGHT', 1) ; 724 static final WrapperKind PREFIXED_RIGHT = new WrapperKind('PREFIXED_RIGHT', 1) ;
726 static final WrapperKind PROPERTY_LEFT = new WrapperKind('PROPERTY_LEFT', 2); 725 static final WrapperKind PROPERTY_LEFT = new WrapperKind('PROPERTY_LEFT', 2);
727 static final WrapperKind PROPERTY_RIGHT = new WrapperKind('PROPERTY_RIGHT', 3) ; 726 static final WrapperKind PROPERTY_RIGHT = new WrapperKind('PROPERTY_RIGHT', 3) ;
728 static final WrapperKind NONE = new WrapperKind('NONE', 4); 727 static final WrapperKind NONE = new WrapperKind('NONE', 4);
729 static final List<WrapperKind> values = [PREFIXED_LEFT, PREFIXED_RIGHT, PROPER TY_LEFT, PROPERTY_RIGHT, NONE]; 728 static final List<WrapperKind> values = [PREFIXED_LEFT, PREFIXED_RIGHT, PROPER TY_LEFT, PROPERTY_RIGHT, NONE];
730 729
731 /// The name of this enum constant, as declared in the enum declaration. 730 /// The name of this enum constant, as declared in the enum declaration.
732 final String name; 731 final String name;
733 732
734 /// The position in the enum declaration. 733 /// The position in the enum declaration.
735 final int ordinal; 734 final int ordinal;
736 WrapperKind(this.name, this.ordinal) { 735 WrapperKind(this.name, this.ordinal);
737 }
738 int compareTo(WrapperKind other) => ordinal - other.ordinal; 736 int compareTo(WrapperKind other) => ordinal - other.ordinal;
739 int get hashCode => ordinal; 737 int get hashCode => ordinal;
740 String toString() => name; 738 String toString() => name;
741 } 739 }
742 class BreadthFirstVisitorTest extends ParserTestCase { 740 class BreadthFirstVisitorTest extends ParserTestCase {
743 void testIt() { 741 void testIt() {
744 String source = EngineTestCase.createSource(["class A {", " bool get g => t rue;", "}", "class B {", " int f() {", " num q() {", " return 3;", " }", " return q() + 4;", " }", "}", "A f(var p) {", " if ((p as A).g) {", " return p;", " } else {", " return null;", " }", "}"]); 742 String source = EngineTestCase.createSource(["class A {", " bool get g => t rue;", "}", "class B {", " int f() {", " num q() {", " return 3;", " }", " return q() + 4;", " }", "}", "A f(var p) {", " if ((p as A).g) {", " return p;", " } else {", " return null;", " }", "}"]);
745 CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []); 743 CompilationUnit unit = ParserTestCase.parseCompilationUnit(source, []);
746 List<ASTNode> nodes = new List<ASTNode>(); 744 List<ASTNode> nodes = new List<ASTNode>();
747 BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_15(nodes); 745 BreadthFirstVisitor<Object> visitor = new BreadthFirstVisitor_15(nodes);
(...skipping 2212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2960 } 2958 }
2961 main() { 2959 main() {
2962 ConstantEvaluatorTest.dartSuite(); 2960 ConstantEvaluatorTest.dartSuite();
2963 NodeLocatorTest.dartSuite(); 2961 NodeLocatorTest.dartSuite();
2964 ToSourceVisitorTest.dartSuite(); 2962 ToSourceVisitorTest.dartSuite();
2965 BreadthFirstVisitorTest.dartSuite(); 2963 BreadthFirstVisitorTest.dartSuite();
2966 IndexExpressionTest.dartSuite(); 2964 IndexExpressionTest.dartSuite();
2967 SimpleIdentifierTest.dartSuite(); 2965 SimpleIdentifierTest.dartSuite();
2968 VariableDeclarationTest.dartSuite(); 2966 VariableDeclarationTest.dartSuite();
2969 } 2967 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698