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

Side by Side Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 717393006: Fix incremental scanner's computation of scanEnd. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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
« no previous file with comments | « pkg/analyzer/test/generated/incremental_scanner_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 engine.parser_test; 5 library engine.parser_test;
6 6
7 import 'package:analyzer/src/generated/ast.dart'; 7 import 'package:analyzer/src/generated/ast.dart';
8 import 'package:analyzer/src/generated/element.dart'; 8 import 'package:analyzer/src/generated/element.dart';
9 import 'package:analyzer/src/generated/error.dart'; 9 import 'package:analyzer/src/generated/error.dart';
10 import 'package:analyzer/src/generated/incremental_scanner.dart'; 10 import 'package:analyzer/src/generated/incremental_scanner.dart';
(...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 void test_insert_simpleToComplexExression() { 2683 void test_insert_simpleToComplexExression() {
2684 // "/** An [A]. */ class A {} class B { m() => 1; }" 2684 // "/** An [A]. */ class A {} class B { m() => 1; }"
2685 // "/** An [A]. */ class A {} class B { m() => 1 + 2; }" 2685 // "/** An [A]. */ class A {} class B { m() => 1 + 2; }"
2686 _assertParse( 2686 _assertParse(
2687 "/** An [A]. */ class A {} class B { m() => 1", 2687 "/** An [A]. */ class A {} class B { m() => 1",
2688 "", 2688 "",
2689 " + 2", 2689 " + 2",
2690 "; }"); 2690 "; }");
2691 } 2691 }
2692 2692
2693 void test_insert_statement_in_method_with_mismatched_braces() {
2694 _assertParse('''
2695 class C {
2696 void f() {
2697 ''', '', 'g();', '''
2698 if (b) {
2699
2700
2701 }
2702
2703 void g() {
2704 h((x) {});
2705 }
2706 }
2707 ''');
2708 }
2709
2693 void test_insert_whitespace_end() { 2710 void test_insert_whitespace_end() {
2694 // "f() => a + b;" 2711 // "f() => a + b;"
2695 // "f() => a + b; " 2712 // "f() => a + b; "
2696 _assertParse("f() => a + b;", "", " ", ""); 2713 _assertParse("f() => a + b;", "", " ", "");
2697 } 2714 }
2698 2715
2699 void test_insert_whitespace_end_multiple() { 2716 void test_insert_whitespace_end_multiple() {
2700 // "f() => a + b;" 2717 // "f() => a + b;"
2701 // "f() => a + b; " 2718 // "f() => a + b; "
2702 _assertParse("f() => a + b;", "", " ", ""); 2719 _assertParse("f() => a + b;", "", " ", "");
(...skipping 8135 matching lines...) Expand 10 before | Expand all | Expand 10 after
10838 // Parse the source. 10855 // Parse the source.
10839 // 10856 //
10840 Parser parser = new Parser(null, listener); 10857 Parser parser = new Parser(null, listener);
10841 return invokeParserMethodImpl( 10858 return invokeParserMethodImpl(
10842 parser, 10859 parser,
10843 methodName, 10860 methodName,
10844 <Object>[tokenStream], 10861 <Object>[tokenStream],
10845 tokenStream) as Token; 10862 tokenStream) as Token;
10846 } 10863 }
10847 } 10864 }
OLDNEW
« no previous file with comments | « pkg/analyzer/test/generated/incremental_scanner_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698