X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/6ee1970906d33f0b1b2be20e2f8a4521a6ca514f..be18b63c233dae3873691486a2d858e600b087f8:/src/pset-parse.lisp?ds=inline diff --git a/src/pset-parse.lisp b/src/pset-parse.lisp index ddc34e0..a2199b6 100644 --- a/src/pset-parse.lisp +++ b/src/pset-parse.lisp @@ -73,7 +73,7 @@ "Parse and evaluate a simple expression. The result is a pair (TYPE . VALUE). Currently, type types are `:id', - `:int', `:string', and `:char'. If an error prevented a sane value from + `:int', `:string', `:char', `:fragment', `:type'. If an error prevented a sane value from being produced, the type `:invalid' is returned. The syntax of expressions is rather limited at the moment, but more may be @@ -100,7 +100,8 @@ (sexp (read stream t))) (scanner-step scanner) (multiple-value-bind (type value) - (decode-property sexp) + (restart-case (decode-property (eval sexp)) + (continue () (values :invalid nil))) (values (cons type value) t t)))) (#\{ (values (cons :fragment @@ -119,7 +120,7 @@ (values (cons :type (car dc)) t t)))) (t - (values (list :int :id :char :string #\?) + (values (list :int :id :char :string #\? #\{ #\<) nil nil))))) (or (seq (#\+) add) (seq (#\-) sub) @@ -133,6 +134,7 @@ ;;;-------------------------------------------------------------------------- ;;; Parsing property sets. +(export 'parse-property) (defun parse-property (scanner pset) "Parse a single property using the SCANNER; add it to the PSET." ;; property ::= id `=' expression