aboutsummaryrefslogtreecommitdiffstats
path: root/eval.cc
diff options
context:
space:
mode:
Diffstat (limited to 'eval.cc')
-rw-r--r--eval.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/eval.cc b/eval.cc
index ab99a01..de49297 100644
--- a/eval.cc
+++ b/eval.cc
@@ -134,7 +134,13 @@ void Evaluator::EvalRule(const RuleAST* ast) {
if (!rule_var.rhs.empty()) {
Value* lit = NewLiteral(rule_var.rhs);
if (rhs) {
- rhs = NewExpr2(lit, rhs);
+ // TODO: We always insert two whitespaces around the
+ // terminator. Preserve whitespaces properly.
+ if (ast->term == ';') {
+ rhs = NewExpr3(lit, NewLiteral(STRING_PIECE(" ; ")), rhs);
+ } else {
+ rhs = NewExpr3(lit, NewLiteral(STRING_PIECE(" = ")), rhs);
+ }
} else {
rhs = lit;
}