#513 closed defect (fixed)
json-abnf chokes on escapes in strings
| Reported by: | Moritz Heidkamp | Owned by: | Ivan Raikov |
|---|---|---|---|
| Priority: | major | Milestone: | 4.9.0 |
| Component: | extensions | Version: | 4.6.x |
| Keywords: | json-abnf | Cc: | |
| Estimated difficulty: |
Description
Parsing JSON strings containing escape sequences like "\n" or "\u0040" fails. To reproduce this, try:
(use json-abnf) (parser "[\"\\n\"]")
which results in:
JSON parser error on stream: ["\n"]
Error: (caar) bad argument type: ()
Call history:
<syntax> (parser "[\"\\n\"]")
<eval> (parser "[\"\\n\"]")
string->list
p291
lexgen#bar
lexgen#bar
lexgen#bar
lexgen#bar
lexgen#bar
lexgen#bar
print <--
Change History (6)
comment:1 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
follow-up: 3 comment:2 by , 15 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
Thanks for the quick fix, Ivan! Now there is another problem: For some reason, strings containing exclamation points still lead to the same error, i.e. the string "!" causes the parser to fail. However, I can't find any special-casing of #\! in the code. Can you see what's going on?
comment:3 by , 15 years ago
I used ucs-range->char-set to create the character sets representing valid characters in a string, but because I didn't RTFSRFI, I didn't realise it excludes the upper bound from the created set. This has been fixed now.
Replying to syn:
Thanks for the quick fix, Ivan! Now there is another problem: For some reason, strings containing exclamation points still lead to the same error, i.e. the string "!" causes the parser to fail. However, I can't find any special-casing of #\! in the code. Can you see what's going on?
comment:4 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |

Fixed in json-abnf release 3.2