(define-indicator :declspec "<declaration-specifier>")
-(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,
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)))))
(parse
(seq ((quals (list ()
- (scan-declspec
+ (scan-simple-declspec
scanner
:indicator :qualifier
:predicate (lambda (ds)