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

Unified Diff: pkg/yaml/lib/src/parser.dart

Issue 274953002: Bring the YAML package's style up to modern standards. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review Created 6 years, 7 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 | « pkg/yaml/lib/src/model.dart ('k') | pkg/yaml/lib/src/utils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/yaml/lib/src/parser.dart
diff --git a/pkg/yaml/lib/src/parser.dart b/pkg/yaml/lib/src/parser.dart
index 162fef475caf644f21d903f974ac6700da14e390..d1e20ff74db7ed90a930295473206e25e1704437 100644
--- a/pkg/yaml/lib/src/parser.dart
+++ b/pkg/yaml/lib/src/parser.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library parser;
+library yaml.parser;
import 'dart:collection';
@@ -407,23 +407,24 @@ class Parser {
error(String message) {
// Line and column should be one-based.
throw new SyntaxError(_line + 1, _column + 1,
- "$message (in $_farthestContext)");
+ "$message (in $_farthestContext).");
}
/// If [result] is falsey, throws an error saying that [expected] was
/// expected.
expect(result, String expected) {
if (truth(result)) return result;
- error("expected $expected");
+ error("Expected $expected");
}
/// Throws an error saying that the parse failed. Uses [_farthestLine],
- /// [_farthestColumn], and [_farthestContext] to provide additional information.
+ /// [_farthestColumn], and [_farthestContext] to provide additional
+ /// information.
parseFailed() {
- var message = "invalid YAML in $_farthestContext";
+ var message = "Invalid YAML in $_farthestContext";
var extraError = _errorAnnotations[_farthestPos];
if (extraError != null) message = "$message ($extraError)";
- throw new SyntaxError(_farthestLine + 1, _farthestColumn + 1, message);
+ throw new SyntaxError(_farthestLine + 1, _farthestColumn + 1, "$message.");
}
/// Returns the number of spaces after the current position.
@@ -788,7 +789,7 @@ class Parser {
case BLOCK_KEY:
case FLOW_KEY:
return s_separateInLine();
- default: throw 'invalid context "$ctx"';
+ default: throw 'Invalid context "$ctx".';
}
}
@@ -1014,7 +1015,7 @@ class Parser {
var char = peek();
var indicator = indicatorType(char);
if (indicator == C_RESERVED) {
- error("reserved indicators can't start a plain scalar");
+ error("Reserved indicators can't start a plain scalar");
}
var match = (isNonSpace(char) && indicator == null) ||
((indicator == C_MAPPING_KEY ||
@@ -1037,7 +1038,7 @@ class Parser {
case FLOW_KEY:
// 129
return isNonSpace(char) && !isFlowIndicator(char);
- default: throw 'invalid context "$ctx"';
+ default: throw 'Invalid context "$ctx".';
}
}
@@ -1066,7 +1067,7 @@ class Parser {
case BLOCK_KEY:
case FLOW_KEY:
return ns_plainOneLine(ctx);
- default: throw 'invalid context "$ctx"';
+ default: throw 'Invalid context "$ctx".';
}
});
});
« no previous file with comments | « pkg/yaml/lib/src/model.dart ('k') | pkg/yaml/lib/src/utils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698