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

Unified Diff: utils/markdown/block_parser.dart

Issue 8739001: Use subscript to get match groups. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | utils/markdown/inline_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/markdown/block_parser.dart
diff --git a/utils/markdown/block_parser.dart b/utils/markdown/block_parser.dart
index b07f49f21afb3608fc632d33d7cea13ef3d37355..d4a46cf9f811ccddce342324cda5baf6fe0cea61 100644
--- a/utils/markdown/block_parser.dart
+++ b/utils/markdown/block_parser.dart
@@ -123,7 +123,7 @@ class BlockSyntax {
while (!parser.isDone) {
final match = pattern.firstMatch(parser.current);
if (match == null) break;
- childLines.add(match.group(1));
+ childLines.add(match[1]);
parser.advance();
}
@@ -159,7 +159,7 @@ class SetextHeaderSyntax extends BlockSyntax {
Node parse(BlockParser parser) {
final match = _RE_SETEXT.firstMatch(parser.next);
- final tag = (match.group(1)[0] == '=') ? 'h1' : 'h2';
+ final tag = (match[1][0] == '=') ? 'h1' : 'h2';
final contents = parser.document.parseInline(parser.current);
parser.advance();
parser.advance();
@@ -175,8 +175,8 @@ class HeaderSyntax extends BlockSyntax {
Node parse(BlockParser parser) {
final match = pattern.firstMatch(parser.current);
parser.advance();
- final level = match.group(1).length;
- final contents = parser.document.parseInline(match.group(2).trim());
+ final level = match[1].length;
+ final contents = parser.document.parseInline(match[2].trim());
return new Element('h$level', contents);
}
}
@@ -289,10 +289,10 @@ class ListSyntax extends BlockSyntax {
} else if (tryMatch(_RE_UL) || tryMatch(_RE_OL)) {
// End the current list item and start a new one.
endItem();
- childLines.add(match.group(1));
+ childLines.add(match[1]);
} else if (tryMatch(_RE_INDENT)) {
// Strip off indent and add to current item.
- childLines.add(match.group(1));
+ childLines.add(match[1]);
} else if (isAtBlockEnd(parser)) {
// Done with the list.
break;
« no previous file with comments | « no previous file | utils/markdown/inline_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698