From: Chris Hanson Date: Mon, 18 Nov 2019 00:35:53 +0000 (-0800) Subject: Fix bug in parsing of cond-expand. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~9 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b51333624dda1756ce3d5510a03df460d84bdd2d;p=mit-scheme.git Fix bug in parsing of cond-expand. --- diff --git a/src/runtime/mit-macros.scm b/src/runtime/mit-macros.scm index 72eed2cb1..0f4c88076 100644 --- a/src/runtime/mit-macros.scm +++ b/src/runtime/mit-macros.scm @@ -708,10 +708,12 @@ USA. (scons-rule `((value id=?) (* (subform (cons ,(feature-requirement-pattern) (* any)))) - (opt (subform (cons (keep-if id=? else) - (* any))))) - (lambda (id=? clauses) - (apply scons-begin (evaluate-cond-expand id=? clauses))))))) + (or (subform (ignore-if id=? else) + (* any)) + (value '()))) + (lambda (id=? clauses else-forms) + (apply scons-begin + (evaluate-cond-expand id=? clauses else-forms))))))) (define (feature-requirement-pattern) (spar-pattern-fixed-point @@ -729,15 +731,14 @@ USA. (define (library-name-pattern) `(subform (* (or symbol ,exact-nonnegative-integer?)))) -(define (evaluate-cond-expand id=? clauses) +(define (evaluate-cond-expand id=? clauses else-forms) (let ((clause (find (lambda (clause) - (or (id=? 'else (car clause)) - (evaluate-feature-requirement id=? (car clause)))) + (evaluate-feature-requirement id=? (car clause))) clauses))) (if clause (cdr clause) - '()))) + else-forms))) (define (evaluate-feature-requirement id=? feature-requirement)