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

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

Issue 762703004: Add incremental parser test for splitting a combinator. (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 | « no previous file | 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 2781 matching lines...) Expand 10 before | Expand all | Expand 10 after
2792 // "f() => a * c - b;" 2792 // "f() => a * c - b;"
2793 _assertParse("f() => a ", "+", "* c -", " b;"); 2793 _assertParse("f() => a ", "+", "* c -", " b;");
2794 } 2794 }
2795 2795
2796 void test_replace_operator_oneForOne() { 2796 void test_replace_operator_oneForOne() {
2797 // "f() => a + b;" 2797 // "f() => a + b;"
2798 // "f() => a * b;" 2798 // "f() => a * b;"
2799 _assertParse("f() => a ", "+", "*", " b;"); 2799 _assertParse("f() => a ", "+", "*", " b;");
2800 } 2800 }
2801 2801
2802 void test_split_combinator() {
2803 // "import 'foo.dart' show A;"
2804 // "import 'foo.dart' show B hide A;"
2805 _assertParse("import 'foo.dart' show ", "", "B hide ", "A;");
2806 }
2807
2802 /** 2808 /**
2803 * Given a description of the original and modified contents, perform an incre mental scan of the 2809 * Given a description of the original and modified contents, perform an incre mental scan of the
2804 * two pieces of text. 2810 * two pieces of text.
2805 * 2811 *
2806 * @param prefix the unchanged text before the edit region 2812 * @param prefix the unchanged text before the edit region
2807 * @param removed the text that was removed from the original contents 2813 * @param removed the text that was removed from the original contents
2808 * @param added the text that was added to the modified contents 2814 * @param added the text that was added to the modified contents
2809 * @param suffix the unchanged text after the edit region 2815 * @param suffix the unchanged text after the edit region
2810 */ 2816 */
2811 void _assertParse(String prefix, String removed, String added, 2817 void _assertParse(String prefix, String removed, String added,
(...skipping 8046 matching lines...) Expand 10 before | Expand all | Expand 10 after
10858 // Parse the source. 10864 // Parse the source.
10859 // 10865 //
10860 Parser parser = new Parser(null, listener); 10866 Parser parser = new Parser(null, listener);
10861 return invokeParserMethodImpl( 10867 return invokeParserMethodImpl(
10862 parser, 10868 parser,
10863 methodName, 10869 methodName,
10864 <Object>[tokenStream], 10870 <Object>[tokenStream],
10865 tokenStream) as Token; 10871 tokenStream) as Token;
10866 } 10872 }
10867 } 10873 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698