diff options
author | Mattias Andrée <maandree@kth.se> | 2021-04-17 21:58:34 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-04-17 21:58:34 +0200 |
commit | da31e311fde94a3c3b26710e8036c38fbedff0de (patch) | |
tree | a8a9c8d7da646d0179cca964d29539a1d07fc86a | |
parent | Add readme (diff) | |
download | libparser-da31e311fde94a3c3b26710e8036c38fbedff0de.tar.gz libparser-da31e311fde94a3c3b26710e8036c38fbedff0de.tar.bz2 libparser-da31e311fde94a3c3b26710e8036c38fbedff0de.tar.xz |
Fix character range grammar
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | libparser-generate.c | 12 |
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') { |