Mutate a compound statement.
General form:
(change-vl-compoundstmt x [:stmts stmts] [:exprs exprs] [:ctrl ctrl] [:vardecls vardecls] [:paramdecls paramdecls])
This expands into a suitable call of change-vl-compoundstmt-core. It allows you to modify statements without paying much attention to the kind of statement being modified.
Note that change-vl-compoundstmt-core has an elaborate guard; e.g., you must provide the same number of statements and expressions, and only provide a :ctrl when there is one, etc.
Macro:
(defmacro change-vl-compoundstmt (x &rest args) (change-vl-compoundstmt-fn x (std::da-changer-args-to-alist 'change-vl-compoundstmt args '(:stmts :exprs :ctrl :vardecls :paramdecls))))
Function:
(defun change-vl-compoundstmt-fn (x alist) (cons 'change-vl-compoundstmt-core (list x (if (assoc :stmts alist) (cdr (assoc :stmts alist)) (list 'vl-compoundstmt->stmts x)) (if (assoc :exprs alist) (cdr (assoc :exprs alist)) (list 'vl-compoundstmt->exprs x)) (if (assoc :ctrl alist) (cdr (assoc :ctrl alist)) (list 'vl-compoundstmt->ctrl x)) (if (assoc :vardecls alist) (cdr (assoc :vardecls alist)) (list 'vl-compoundstmt->vardecls x)) (if (assoc :paramdecls alist) (cdr (assoc :paramdecls alist)) (list 'vl-compoundstmt->paramdecls x)))))