(formal->parser x world) → parser-fn
Function:
(defun formal->parser (x world) (declare (xargs :guard (and (formal-p x) (plist-worldp world)))) (let ((__function__ 'formal->parser)) (declare (ignorable __function__)) (b* (((formal x) x) (parser (cdr (assoc :parser x.opts))) ((when parser) (check-plausibly-a-parser-p x.name parser world) parser) ((unless (and (tuplep 2 x.guard) (equal (second x.guard) x.name))) (raise "In ~x0, there's no :parser and the type isn't simple enough ~ to infer a default." x.name)) (predicate (first x.guard)) (parser (default-getopt-parser predicate world)) ((when parser) (check-plausibly-a-parser-p x.name parser world) parser)) (raise "In ~x0, there's no :parser and there's no default parser for type ~ ~x1." x.name predicate))))