aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-17 21:58:34 +0200
committerMattias Andrée <maandree@kth.se>2021-04-17 21:58:34 +0200
commitda31e311fde94a3c3b26710e8036c38fbedff0de (patch)
treea8a9c8d7da646d0179cca964d29539a1d07fc86a
parentAdd readme (diff)
downloadlibparser-da31e311fde94a3c3b26710e8036c38fbedff0de.tar.gz
libparser-da31e311fde94a3c3b26710e8036c38fbedff0de.tar.bz2
libparser-da31e311fde94a3c3b26710e8036c38fbedff0de.tar.xz
Fix character range grammar
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libparser-generate.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libparser-generate.c b/libparser-generate.c
index c027300..5b8ae25 100644
--- a/libparser-generate.c
+++ b/libparser-generate.c
@@ -703,14 +703,16 @@ again:
goto invalid_range;
} else if (tokens[i]->s[1] == '\\') {
j = 3;
- if (tokens[i]->s[2] == 'a') {
+ if (tokens[i]->s[2] == '"') {
+ tokens[i]->s[1] = '"';
+ } else if (tokens[i]->s[2] == '\'') {
+ tokens[i]->s[1] = '\'';
+ } else if (tokens[i]->s[2] == '\\') {
+ tokens[i]->s[1] = '\\';
+ } else if (tokens[i]->s[2] == 'a') {
tokens[i]->s[1] = '\a';
} else if (tokens[i]->s[2] == 'b') {
tokens[i]->s[1] = '\b';
- } else if (tokens[i]->s[2] == 'e') {
- tokens[i]->s[1] = '\x1b';
- } else if (tokens[i]->s[2] == 'E') {
- tokens[i]->s[1] = '\x1b';
} else if (tokens[i]->s[2] == 'f') {
tokens[i]->s[1] = '\f';
} else if (tokens[i]->s[2] == 'n') {