aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--dep.cc4
-rw-r--r--eval.cc2
-rw-r--r--parser.cc2
3 files changed, 6 insertions, 2 deletions
diff --git a/dep.cc b/dep.cc
index 789ffda..e902ad3 100644
--- a/dep.cc
+++ b/dep.cc
@@ -140,9 +140,9 @@ class DepBuilder {
}
if (!old_rule.cmds.empty() && !rule.cmds.empty() &&
!is_suffix_rule && !rule.is_double_colon) {
- WARN("%s:%d: overriding commands for target `%s'",
+ WARN("%s:%d: warning: overriding commands for target `%s'",
LOCF(rule.cmd_loc()), output.as_string().c_str());
- WARN("%s:%d: ignoring old commands for target `%s'",
+ WARN("%s:%d: warning: ignoring old commands for target `%s'",
LOCF(old_rule.cmd_loc()), output.as_string().c_str());
}
diff --git a/eval.cc b/eval.cc
index ccbcf77..a6c1e79 100644
--- a/eval.cc
+++ b/eval.cc
@@ -164,6 +164,8 @@ void Evaluator::EvalCommand(const CommandAST* ast) {
}
last_rule_->cmds.push_back(ast->expr);
+ if (last_rule_->cmd_lineno == 0)
+ last_rule_->cmd_lineno = ast->loc().lineno;
LOG("Command: %s", ast->expr->DebugString().c_str());
}
diff --git a/parser.cc b/parser.cc
index 3bec5be..cfdf912 100644
--- a/parser.cc
+++ b/parser.cc
@@ -226,6 +226,7 @@ class Parser {
ast->expr = ParseExpr(line);
ast->should_exist = directive[0] == 'i';
out_asts_->push_back(ast);
+ state_ = ParserState::NOT_AFTER_RULE;
}
void ParseDefine(StringPiece line, StringPiece) {
@@ -235,6 +236,7 @@ class Parser {
define_name_ = line;
define_start_ = 0;
define_start_line_ = loc_.lineno;
+ state_ = ParserState::NOT_AFTER_RULE;
}
void ParseInsideDefine(StringPiece line) {