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

Unified Diff: lib/src/document.dart

Issue 1274763005: Clean up: (Closed) Base URL: https://github.com/dart-lang/markdown.git@master
Patch Set: Bump. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/block_parser.dart ('k') | lib/src/html_renderer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/document.dart
diff --git a/lib/src/document.dart b/lib/src/document.dart
index 79f7c31d6b984927d20e5b8b36cb0f771265620f..71a29d917f1b3e4636a30bdf33d8f94a1d37e325 100644
--- a/lib/src/document.dart
+++ b/lib/src/document.dart
@@ -1,4 +1,4 @@
-library markdown.document;
+library markdown.src.document;
import 'ast.dart';
import 'block_parser.dart';
@@ -19,16 +19,16 @@ class Document {
// [id]: http:foo.com "some title"
// Where there may whitespace in there, and where the title may be in
// single quotes, double quotes, or parentheses.
- final indent = r'^[ ]{0,3}'; // Leading indentation.
- final id = r'\[([^\]]+)\]'; // Reference id in [brackets].
- final quote = r'"[^"]+"'; // Title in "double quotes".
- final apos = r"'[^']+'"; // Title in 'single quotes'.
- final paren = r"\([^)]+\)"; // Title in (parentheses).
- final pattern = new RegExp(
- '$indent$id:\\s+(\\S+)\\s*($quote|$apos|$paren|)\\s*\$');
+ var indent = r'^[ ]{0,3}'; // Leading indentation.
+ var id = r'\[([^\]]+)\]'; // Reference id in [brackets].
+ var quote = r'"[^"]+"'; // Title in "double quotes".
+ var apos = r"'[^']+'"; // Title in 'single quotes'.
+ var paren = r"\([^)]+\)"; // Title in (parentheses).
+ var pattern =
+ new RegExp('$indent$id:\\s+(\\S+)\\s*($quote|$apos|$paren|)\\s*\$');
- for (int i = 0; i < lines.length; i++) {
- final match = pattern.firstMatch(lines[i]);
+ for (var i = 0; i < lines.length; i++) {
+ var match = pattern.firstMatch(lines[i]);
if (match != null) {
// Parse the link.
var id = match[1];
@@ -57,13 +57,13 @@ class Document {
/// Parse the given [lines] of markdown to a series of AST nodes.
List<Node> parseLines(List<String> lines) {
- final parser = new BlockParser(lines, this);
+ var parser = new BlockParser(lines, this);
- final blocks = [];
+ var blocks = <Node>[];
while (!parser.isDone) {
- for (final syntax in BlockSyntax.syntaxes) {
+ for (var syntax in BlockSyntax.syntaxes) {
if (syntax.canParse(parser)) {
- final block = syntax.parse(parser);
+ var block = syntax.parse(parser);
if (block != null) blocks.add(block);
break;
}
« no previous file with comments | « lib/src/block_parser.dart ('k') | lib/src/html_renderer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698