summaryrefslogtreecommitdiffstats
path: root/parse.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'parse.cxx')
-rw-r--r--parse.cxx28
1 files changed, 26 insertions, 2 deletions
diff --git a/parse.cxx b/parse.cxx
index 5b25a9c0..4a4b973f 100644
--- a/parse.cxx
+++ b/parse.cxx
@@ -332,8 +332,32 @@ lexer::scan ()
if (c == '\"') // closing double-quotes
break;
else if (c == '\\')
- {
- // XXX: handle escape sequences
+ {
+ c = input_get ();
+ switch (c)
+ {
+ case 'a':
+ case 'b':
+ case 't':
+ case 'n':
+ case 'v':
+ case 'f':
+ case 'r':
+ case '\\':
+
+ // Pass these escapes through to the string value
+ // beign parsed; it will "likely" be emitted into
+ // a C literal.
+ //
+ // XXX: verify this assumption.
+
+ n->content.push_back('\\');
+
+ default:
+
+ n->content.push_back(c);
+ break;
+ }
}
else
n->content.push_back(c);