X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/7ca1b1eff75521ed91b4efb4d69f90df6e1fa851..3088c93403f4b8c015ecc6f789248ebef644ddcb:/src/c-types-parse.lisp diff --git a/src/c-types-parse.lisp b/src/c-types-parse.lisp index 4475c72..2c0e725 100644 --- a/src/c-types-parse.lisp +++ b/src/c-types-parse.lisp @@ -224,9 +224,13 @@ (define-indicator :declspec "") -(defun scan-declspec +(defun scan-simple-declspec (scanner &key (predicate (constantly t)) (indicator :declspec)) - "Scan a `declspec' from SCANNER. + "Scan a simple `declspec' from SCANNER. + + Simple declspecs are the ones defined in the `*declspec-map*' or + `*module-type-map*'. This covers the remaining possibilities if the + `complex-declspec' pluggable parser didn't find anything to match. If PREDICATE is provided then only succeed if (funcall PREDICATE DECLSPEC) is true, where DECLSPEC is the raw declaration specifier or C-type object, @@ -266,7 +270,9 @@ SPECS." (with-parser-context (token-scanner-context :scanner scanner) - (if-parse (:consumedp consumedp) (scan-declspec scanner) + (if-parse (:consumedp consumedp) + (or (plug complex-declspec scanner) + (scan-simple-declspec scanner)) (aif (combine-declspec specs it) (values it t consumedp) (values (list :declspec) nil consumedp))))) @@ -329,7 +335,7 @@ (parse (seq ((quals (list () - (scan-declspec + (scan-simple-declspec scanner :indicator :qualifier :predicate (lambda (ds)