Robust parsing of map literals.

This commit is contained in:
Kyle 2015-04-06 10:09:11 -07:00
parent 55aeec08d3
commit e14ffc164f
1 changed files with 10 additions and 11 deletions

View File

@ -23,10 +23,10 @@
(reverse (concatenate 'string x)))
(finalise-kv-pair ()
(if key-p
(progn
(unless (null k)
(setq key-p nil
k (read-from-string (finalise-read k))))
(progn
(unless (null v)
(setq key-p t
v (read-from-string (finalise-read v)))
(setf (gethash k m) v)
@ -39,8 +39,7 @@
(if key-p
(push prev k)
(push prev v))))
(if (and (null k)
(null v))
(if (and (null v) (not (null k)))
(error "Mismatched key value pairs.")
(progn
(finalise-kv-pair)