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

Side by Side Diff: pkg/analyzer_experimental/lib/src/generated/parser.dart

Issue 17009007: Tweak j2d for String.indexOf(s,int) semantics. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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.parser; 3 library engine.parser;
4 import 'dart:collection'; 4 import 'dart:collection';
5 import 'java_core.dart'; 5 import 'java_core.dart';
6 import 'java_engine.dart'; 6 import 'java_engine.dart';
7 import 'instrumentation.dart'; 7 import 'instrumentation.dart';
8 import 'error.dart'; 8 import 'error.dart';
9 import 'source.dart'; 9 import 'source.dart';
10 import 'scanner.dart'; 10 import 'scanner.dart';
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 } 604 }
605 if (JavaString.startsWithBefore(comment, "* ", index)) { 605 if (JavaString.startsWithBefore(comment, "* ", index)) {
606 int end = index + 6; 606 int end = index + 6;
607 while (end < length && comment.codeUnitAt(end) != 0xD && comment.codeU nitAt(end) != 0xA) { 607 while (end < length && comment.codeUnitAt(end) != 0xD && comment.codeU nitAt(end) != 0xA) {
608 end = end + 1; 608 end = end + 1;
609 } 609 }
610 ranges.add(<int> [index, end]); 610 ranges.add(<int> [index, end]);
611 index = end; 611 index = end;
612 } 612 }
613 } else if (JavaString.startsWithBefore(comment, "[:", index)) { 613 } else if (JavaString.startsWithBefore(comment, "[:", index)) {
614 int end = comment.indexOf(":]", index + 2); 614 int end = JavaString.indexOf(comment, ":]", index + 2);
615 if (end < 0) { 615 if (end < 0) {
616 end = length; 616 end = length;
617 } 617 }
618 ranges.add(<int> [index, end]); 618 ranges.add(<int> [index, end]);
619 index = end + 1; 619 index = end + 1;
620 } else { 620 } else {
621 index = index + 1; 621 index = index + 1;
622 } 622 }
623 } 623 }
624 return ranges; 624 return ranges;
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
1722 List<CommentReference> parseCommentReferences(List<Token> tokens) { 1722 List<CommentReference> parseCommentReferences(List<Token> tokens) {
1723 List<CommentReference> references = new List<CommentReference>(); 1723 List<CommentReference> references = new List<CommentReference>();
1724 for (Token token in tokens) { 1724 for (Token token in tokens) {
1725 String comment = token.lexeme; 1725 String comment = token.lexeme;
1726 int length = comment.length; 1726 int length = comment.length;
1727 List<List<int>> codeBlockRanges = getCodeBlockRanges(comment); 1727 List<List<int>> codeBlockRanges = getCodeBlockRanges(comment);
1728 int leftIndex = comment.indexOf('['); 1728 int leftIndex = comment.indexOf('[');
1729 while (leftIndex >= 0 && leftIndex + 1 < length) { 1729 while (leftIndex >= 0 && leftIndex + 1 < length) {
1730 List<int> range = findRange(codeBlockRanges, leftIndex); 1730 List<int> range = findRange(codeBlockRanges, leftIndex);
1731 if (range == null) { 1731 if (range == null) {
1732 int rightIndex = comment.indexOf(']', leftIndex); 1732 int rightIndex = JavaString.indexOf(comment, ']', leftIndex);
1733 if (rightIndex >= 0) { 1733 if (rightIndex >= 0) {
1734 int firstChar = comment.codeUnitAt(leftIndex + 1); 1734 int firstChar = comment.codeUnitAt(leftIndex + 1);
1735 if (firstChar != 0x27 && firstChar != 0x22) { 1735 if (firstChar != 0x27 && firstChar != 0x22) {
1736 if (isLinkText(comment, rightIndex)) { 1736 if (isLinkText(comment, rightIndex)) {
1737 } else { 1737 } else {
1738 CommentReference reference = parseCommentReference(comment.subst ring(leftIndex + 1, rightIndex), token.offset + leftIndex + 1); 1738 CommentReference reference = parseCommentReference(comment.subst ring(leftIndex + 1, rightIndex), token.offset + leftIndex + 1);
1739 if (reference != null) { 1739 if (reference != null) {
1740 references.add(reference); 1740 references.add(reference);
1741 } 1741 }
1742 } 1742 }
1743 } 1743 }
1744 } else { 1744 } else {
1745 rightIndex = leftIndex + 1; 1745 rightIndex = leftIndex + 1;
1746 } 1746 }
1747 leftIndex = comment.indexOf('[', rightIndex); 1747 leftIndex = JavaString.indexOf(comment, '[', rightIndex);
1748 } else { 1748 } else {
1749 leftIndex = comment.indexOf('[', range[1] + 1); 1749 leftIndex = JavaString.indexOf(comment, '[', range[1] + 1);
1750 } 1750 }
1751 } 1751 }
1752 } 1752 }
1753 return references; 1753 return references;
1754 } 1754 }
1755 1755
1756 /** 1756 /**
1757 * Parse a compilation unit. 1757 * Parse a compilation unit.
1758 * 1758 *
1759 * Specified: 1759 * Specified:
(...skipping 4502 matching lines...) Expand 10 before | Expand all | Expand 10 after
6262 for (int i = 0; i < size; i++) { 6262 for (int i = 0; i < size; i++) {
6263 if (i > 0) { 6263 if (i > 0) {
6264 _writer.print(separator); 6264 _writer.print(separator);
6265 } 6265 }
6266 nodes[i].accept(this); 6266 nodes[i].accept(this);
6267 } 6267 }
6268 } 6268 }
6269 } 6269 }
6270 } 6270 }
6271 } 6271 }
OLDNEW
« no previous file with comments | « pkg/analyzer_experimental/lib/src/generated/java_core.dart ('k') | pkg/analyzer_experimental/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698