diff options
author | Nicolas Despres <nicolas.despres@gmail.com> | 2016-05-24 10:12:28 (GMT) |
---|---|---|
committer | Nicolas Despres <nicolas.despres@gmail.com> | 2016-05-25 07:11:38 (GMT) |
commit | ccaa3d1c9c8a581ce0cd696a3b0d6ab713908e40 (patch) | |
tree | 542cd73d33789eb7b979d3b23223baf8dc603fea /src/manifest_parser.cc | |
parent | 63a8584b069a32b871237fc80dcb4c397b863ef7 (diff) | |
download | Ninja-ccaa3d1c9c8a581ce0cd696a3b0d6ab713908e40.zip Ninja-ccaa3d1c9c8a581ce0cd696a3b0d6ab713908e40.tar.gz Ninja-ccaa3d1c9c8a581ce0cd696a3b0d6ab713908e40.tar.bz2 |
Parser accepts no explicit outputs.
There is a class of commands that take an output directory where
they create their output files. Among them are cp(1), tar(1) to name a
few. These commands have one or more implicit outputs but no explicit
output.
With this patch, Ninja's parser accepts build edge with an
empty list of explicit outputs.
Diffstat (limited to 'src/manifest_parser.cc')
-rw-r--r-- | src/manifest_parser.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/manifest_parser.cc b/src/manifest_parser.cc index a4f489e..d6dcf22 100644 --- a/src/manifest_parser.cc +++ b/src/manifest_parser.cc @@ -236,16 +236,13 @@ bool ManifestParser::ParseEdge(string* err) { EvalString out; if (!lexer_.ReadPath(&out, err)) return false; - if (out.empty()) - return lexer_.Error("expected path", err); - - do { + while (!out.empty()) { outs.push_back(out); out.Clear(); if (!lexer_.ReadPath(&out, err)) return false; - } while (!out.empty()); + } } // Add all implicit outs, counting how many as we go. @@ -262,6 +259,9 @@ bool ManifestParser::ParseEdge(string* err) { } } + if (outs.empty()) + return lexer_.Error("expected path", err); + if (!ExpectToken(Lexer::COLON, err)) return false; |