summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-01-12 16:09:13 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-01-12 16:09:13 -0500
commit227c87323603dc0b338e89997d2fce7ffc755fb0 (patch)
treee4130a31cf93875c66cb452ebcf893a4d2254f25 /src
parent8eab6ba5a16002cd6e5ddfb6a09cb23b351c9d32 (diff)
Allow escaped backslashes in literals; conversion betwixt int and char
Diffstat (limited to 'src')
-rw-r--r--src/c/urweb.c8
-rw-r--r--src/urweb.lex1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 006e2e28..8ccecdaa 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -3375,6 +3375,14 @@ uw_Basis_char uw_Basis_toupper(uw_context ctx, uw_Basis_char c) {
return toupper(c);
}
+uw_Basis_int uw_Basis_ord(uw_context ctx, uw_Basis_char c) {
+ return (unsigned char)c;
+}
+
+uw_Basis_char uw_Basis_chr(uw_context ctx, uw_Basis_int n) {
+ return n;
+}
+
uw_Basis_string uw_Basis_currentUrl(uw_context ctx) {
return ctx->current_url;
}
diff --git a/src/urweb.lex b/src/urweb.lex
index d2227d16..45f555dd 100644
--- a/src/urweb.lex
+++ b/src/urweb.lex
@@ -198,6 +198,7 @@ xint = x[0-9a-fA-F][0-9a-fA-F];
<STRING,CHAR> "\\\"" => (str := #"\"" :: !str; continue());
<STRING,CHAR> "\\'" => (str := #"'" :: !str; continue());
<STRING,CHAR> "\\n" => (str := #"\n" :: !str; continue());
+<STRING,CHAR> "\\\\" => (str := #"\\" :: !str; continue());
<STRING,CHAR> "\\t" => (str := #"\t" :: !str; continue());
<STRING,CHAR> "\n" => (newline yypos;
str := #"\n" :: !str; continue());