Merge pull request #224 from metti/parser

Expression Parser: Retain single '$' signs before terminators
diff --git a/src/expr.cc b/src/expr.cc
index 8132a48..48a9e6a 100644
--- a/src/expr.cc
+++ b/src/expr.cc
@@ -551,6 +551,7 @@
       }
 
       if (terms && strchr(terms, s[i + 1])) {
+        list.push_back(new Literal(StringPiece("$")));
         *index_out = i + 1;
         return Value::NewExpr(item_loc, &list);
       }
diff --git a/testcase/simple_subst.mk b/testcase/simple_subst.mk
new file mode 100644
index 0000000..c9faed6
--- /dev/null
+++ b/testcase/simple_subst.mk
@@ -0,0 +1,4 @@
+foo := $(subst a,$,bab)
+
+test:
+	echo $(foo)