From: Mark Wooding Date: Mon, 9 Jul 2018 12:03:48 +0000 (+0100) Subject: src/module-parse.lisp (parse-class-body): Refactor superclass list. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/commitdiff_plain/d1c01c331ae3f2994d65b9d41655b0d4f2fcbf3d?ds=sidebyside src/module-parse.lisp (parse-class-body): Refactor superclass list. Arrange to be able to do more computation on the direct superclass list. No functional change for now. --- diff --git a/src/module-parse.lisp b/src/module-parse.lisp index c5b28a6..0a3cd28 100644 --- a/src/module-parse.lisp +++ b/src/module-parse.lisp @@ -260,6 +260,14 @@ (defun parse-class-body (scanner pset name supers) (with-parser-context (token-scanner-context :scanner scanner) (when name (make-class-type name)) (let* ((duff (null name)) + (superclasses + (let ((superclasses (restart-case + (mapcar #'find-sod-class + (or supers (list "SodObject"))) + (continue () + (setf duff t) + (list (find-sod-class "SodObject")))))) + superclasses)) (synthetic-name (or name (let ((var (synthetic-name))) (unless pset @@ -267,14 +275,7 @@ (defun parse-class-body (scanner pset name supers) (unless (pset-get pset "nick") (add-property pset "nick" var :type :id)) var))) - (class (make-sod-class synthetic-name - (restart-case - (mapcar #'find-sod-class - (or supers (list "SodObject"))) - (continue () - (setf duff t) - (list (find-sod-class "SodObject")))) - pset scanner)) + (class (make-sod-class synthetic-name superclasses pset scanner)) (nick (sod-class-nickname class))) (labels ((must-id ()