#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 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 follow-up: 3 Changed 14 years ago by
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 Changed 14 years ago by
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 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in json-abnf release 3.2