json: fix checking of word boundary after true, false, and null

Thanks to Greg Hendershott for pointing out the problem.
This commit is contained in:
Matthew Flatt 2019-03-02 05:38:06 -07:00
parent 33a5c30073
commit c890edeea4
2 changed files with 4 additions and 3 deletions

View File

@ -174,6 +174,7 @@
(string->jsexpr " [\"x\",1, \"y\",2} ") =error> "string->jsexpr:"
(string->jsexpr @T{ truelove }) =error> "string->jsexpr:"
(string->jsexpr @T{ truebred }) =error> "string->jsexpr:"
(string->jsexpr @T{ truea }) =error> "string->jsexpr:"
(string->jsexpr @T{ falsehood }) =error> "string->jsexpr:"
(string->jsexpr @T{ falsetto }) =error> "string->jsexpr:"
(string->jsexpr @T{ nullity }) =error> "string->jsexpr:"

View File

@ -310,9 +310,9 @@
;; Check for delimiter, defined for our purposes as matching #rx"\\b":
(define b (peek-byte i))
(unless (eof-object? b)
(when (or (< (char->integer #\a) b (char->integer #\z))
(< (char->integer #\A) b (char->integer #\Z))
(< (char->integer #\0) b (char->integer #\9))
(when (or (<= (char->integer #\a) b (char->integer #\z))
(<= (char->integer #\A) b (char->integer #\Z))
(<= (char->integer #\0) b (char->integer #\9))
(eqv? b (char->integer #\_)))
(bad-input bstr))))
;;