;;; along with SOD; if not, write to the Free Software Foundation,
;;; Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+(in-package #:sod)
+
;;;--------------------------------------------------------------------------
;;; The expression parser.
(let* ((stream (make-scanner-stream scanner))
(sexp (read stream t)))
(scanner-step scanner)
- (values (cons (property-type sexp) sexp)
- t t)))
+ (multiple-value-bind (type value)
+ (decode-property sexp)
+ (values (cons type value) t t))))
(t
(values (list :int :id :char :string #\?)
nil nil)))))
(export 'parse-property-set)
(defun parse-property-set (scanner)
- "Parse an optional property set from the SCANNER and return it, or `nil'."
+ "Parse an optional property set from the SCANNER and return it."
;; property-set ::= [`[' property-list `]']
(with-parser-context (token-scanner-context :scanner scanner)
(parse (? (seq (#\[
(pset (many (pset (make-property-set) pset)
- (parse-property scanner pset)
+ (error ()
+ (parse-property scanner pset)
+ (skip-until () #\, #\]))
#\,))
#\])
pset)))))