These aren't worth failing the whole class construction over, but they
do mean that the individual class-item shouldn't be recorded.
This approach seems generally easier than reporting continuable errors
and then indicating failure in some other way, particularly in the case
of slots with initializers.
(parse (seq ((body (or (seq ("extern" #\;) nil)
(parse-delimited-fragment
scanner #\{ #\}))))
(parse (seq ((body (or (seq ("extern" #\;) nil)
(parse-delimited-fragment
scanner #\{ #\}))))
- (make-sod-method class sub-nick name type
- body sub-pset scanner))))
+ (restart-case
+ (make-sod-method class sub-nick name type
+ body sub-pset scanner)
+ (continue () :report "Continue")))))
(parse-initializer ()
;; initializer ::= `=' c-fragment
(parse-initializer ()
;; initializer ::= `=' c-fragment
;;
;; init-declarator ::= declarator [initializer]
(flet ((make-it (name type init)
;;
;; init-declarator ::= declarator [initializer]
(flet ((make-it (name type init)
- (make-sod-slot class name type
- sub-pset scanner)
- (when init
- (make-sod-instance-initializer class
- nick name
- init
- sub-pset
- scanner))))
+ (restart-case
+ (progn
+ (make-sod-slot class name type
+ sub-pset scanner)
+ (when init
+ (make-sod-instance-initializer class
+ nick name
+ init
+ sub-pset
+ scanner)))
+ (continue () :report "Continue"))))
(parse (and (seq ((init (? (parse-initializer))))
(make-it name type init))
(skip-many ()
(parse (and (seq ((init (? (parse-initializer))))
(make-it name type init))
(skip-many ()
(parse (and (skip-many ()
(seq ((name-a :id) #\. (name-b :id)
(init (funcall parse-init)))
(parse (and (skip-many ()
(seq ((name-a :id) #\. (name-b :id)
(init (funcall parse-init)))
- (funcall constructor class
- name-a name-b init
- sub-pset scanner))
+ (restart-case
+ (funcall constructor class
+ name-a name-b init
+ sub-pset scanner)
+ (continue () :report "Continue")))