From: Evan Jones Date: Wed, 4 Jan 2012 16:40:30 +0000 (-0500) Subject: Add a space to unexpected token errors. X-Git-Tag: release-120715~160 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b12139c13e8924ce4d0e634f5798274a5d87f5d7;p=platform%2Fupstream%2Fninja.git Add a space to unexpected token errors. --- diff --git a/src/parsers.cc b/src/parsers.cc index 506b209..afb097a 100644 --- a/src/parsers.cc +++ b/src/parsers.cc @@ -78,7 +78,7 @@ bool ManifestParser::Parse(const string& filename, const string& input, case Lexer::NEWLINE: break; default: - return lexer_.Error(string("unexpected") + Lexer::TokenName(token), + return lexer_.Error(string("unexpected ") + Lexer::TokenName(token), err); } } diff --git a/src/parsers_test.cc b/src/parsers_test.cc index 9d46beb..e7047da 100644 --- a/src/parsers_test.cc +++ b/src/parsers_test.cc @@ -448,6 +448,13 @@ TEST_F(ParserTest, Errors) { // as we see them, not after we've read them all! EXPECT_EQ("input:4: empty path\n", err); } + + { + ManifestParser parser(NULL, NULL); + string err; + EXPECT_FALSE(parser.ParseTest(" # bad indented comment\n", &err)); + EXPECT_EQ("input:1: unexpected indent\n", err); + } } TEST_F(ParserTest, MultipleOutputs)