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

Issue 10886055: Add a friendly error message for using a tab as indentation. (Closed)

Created:
8 years, 3 months ago by nweiz
Modified:
8 years, 3 months ago
Reviewers:
Bob Nystrom
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add a friendly error message for using a tab as indentation. BUG=4813 Committed: https://code.google.com/p/dart/source/detail?r=11644

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+115 lines, -5 lines) Patch
M utils/pub/yaml/parser.dart View 8 chunks +100 lines, -5 lines 4 comments Download
M utils/tests/pub/yaml_test.dart View 1 chunk +15 lines, -0 lines 4 comments Download

Messages

Total messages: 3 (0 generated)
nweiz
8 years, 3 months ago (2012-08-29 23:01:44 UTC) #1
Bob Nystrom
Couple of suggestions. After those, LGTM. https://chromiumcodereview.appspot.com/10886055/diff/1/utils/pub/yaml/parser.dart File utils/pub/yaml/parser.dart (right): https://chromiumcodereview.appspot.com/10886055/diff/1/utils/pub/yaml/parser.dart#newcode712 utils/pub/yaml/parser.dart:712: annotateError("\\t is not ...
8 years, 3 months ago (2012-08-30 16:43:51 UTC) #2
nweiz
8 years, 3 months ago (2012-08-30 19:19:02 UTC) #3
https://chromiumcodereview.appspot.com/10886055/diff/1/utils/pub/yaml/parser....
File utils/pub/yaml/parser.dart (right):

https://chromiumcodereview.appspot.com/10886055/diff/1/utils/pub/yaml/parser....
utils/pub/yaml/parser.dart:712: annotateError("\\t is not allowed as indentation
in YAML",
On 2012/08/30 16:43:51, Bob Nystrom wrote:
> I would use "tab characters" instead of the escape sequence here.

Done.

https://chromiumcodereview.appspot.com/10886055/diff/1/utils/pub/yaml/parser....
utils/pub/yaml/parser.dart:723: annotateError("\\t is not allowed as indentation
in YAML", () {
On 2012/08/30 16:43:51, Bob Nystrom wrote:
> Ditto.

Done.

https://chromiumcodereview.appspot.com/10886055/diff/1/utils/tests/pub/yaml_t...
File utils/tests/pub/yaml_test.dart (right):

https://chromiumcodereview.appspot.com/10886055/diff/1/utils/tests/pub/yaml_t...
utils/tests/pub/yaml_test.dart:75: Expect.throws(() => loadYaml('foo:\n\tbar'),
On 2012/08/30 16:43:51, Bob Nystrom wrote:
> expect(() => loadYaml('foo:\n\tbar'),
>     throwsA(contains('\\t is not allowed as indentation'));

Done, although just "contains()" doesn't work here, since we're matching against
an exception rather than a string.

https://chromiumcodereview.appspot.com/10886055/diff/1/utils/tests/pub/yaml_t...
utils/tests/pub/yaml_test.dart:84: (e) => !e.toString().contains('\\t is not
allowed as indentation'));
On 2012/08/30 16:43:51, Bob Nystrom wrote:
> Ditto.
> 
> We're trying to phase out all uses of Expect and eventually eliminate it from
> corelib.

Done.

Powered by Google App Engine
This is Rietveld 408576698