Skip to content

Commit

Permalink
Merge pull request #5 from thodg/master
Browse files Browse the repository at this point in the history
Fix for lodash.js
  • Loading branch information
mishoo committed Jun 20, 2015
2 parents c42d452 + 244106a commit 429c5e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/codegen.lisp
Expand Up @@ -18,7 +18,12 @@ characters in string S to STREAM."
do (write-char #\\ stream) (write-char ch stream)
else if (setq special (car (rassoc ch +json-lisp-escaped-chars+)))
do (write-char #\\ stream) (write-char special stream)
else do (write-char ch stream))
else if (< #x1f code #x7f)
do (write-char ch stream)
else
do (let ((special '#.(rassoc-if #'consp +json-lisp-escaped-chars+)))
(destructuring-bind (esc . (width . radix)) special
(format stream "\\~C~V,V,'0R" esc radix width code))))
(write-char quote stream))
;;; </cl-json>

Expand Down
1 change: 1 addition & 0 deletions src/constants.lisp
Expand Up @@ -3,6 +3,7 @@
;;; <cl-json> --- the following is taken from cl-json
(defparameter +json-lisp-escaped-chars+
'((#\\ . #\\)
(#\/ . #\/)
(#\b . #\Backspace)
(#\f . #\ )
(#\n . #\Newline)
Expand Down
3 changes: 2 additions & 1 deletion src/squeeze.lisp
Expand Up @@ -18,7 +18,8 @@
(:method ((op (eql :*)) (left number) (right number))
(* left right))
(:method ((op (eql :/)) (left number) (right number))
(/ left right))
(unless (zerop right)
(/ left right)))
(:method ((op (eql :<<)) (left number) (right number))
(ash left right))
(:method ((op (eql :>>)) (left number) (right number))
Expand Down

0 comments on commit 429c5e1

Please sign in to comment.