Skip to content

Commit

Permalink
fix cond-expand to skip not-matched symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Jan 28, 2024
1 parent 55be63d commit 454969c
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 34 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
* various fixes to `syntax-rules`
* fix `procedure?` to return true for continuations
* fix `lips --help` screen
* fix `cond-expand` to skip not-matched symbols

## 1.0.0-beta.18
### Breaking
Expand Down
4 changes: 2 additions & 2 deletions bin/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ function print_error(e, stack) {
console.error('Thrown exception is in global exception variable, use ' +
'(display exception.stack) to display JS stack trace');
}
global.exception = e;}

global.exception = e;
}

// -----------------------------------------------------------------------------
function print(result) {
Expand Down
4 changes: 2 additions & 2 deletions dist/std.min.scm

Large diffs are not rendered by default.

41 changes: 26 additions & 15 deletions dist/std.scm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified dist/std.xcb
Binary file not shown.
41 changes: 26 additions & 15 deletions lib/R7RS.scm
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,9 @@
;; -----------------------------------------------------------------------------
(define-syntax cond-expand
(syntax-rules (and or not else r7rs srfi-0 srfi-2 srfi-4 srfi-6 srfi-10
srfi-22 srfi-23 srfi-46 srfi-176 lips complex full-unicode
ieee-float ratios exact-complex full-numeric-tower)
srfi-22 srfi-23 srfi-46 srfi-139 srfi-176 lips r7rs
complex full-unicode ieee-float ratios exact-complex
full-numeric-tower)
((cond-expand) (syntax-error "Unfulfilled cond-expand"))
((cond-expand (else body ...))
(begin body ...))
Expand Down Expand Up @@ -564,27 +565,29 @@
(req
(cond-expand more-clauses ...))
(else body ...)))
((cond-expand (r7rs body ...) more-clauses ...)
((cond-expand (r7rs body ...) more-clauses ...)
(begin body ...))
((cond-expand (srfi-0 body ...) more-clauses ...)
((cond-expand (srfi-0 body ...) more-clauses ...)
(begin body ...))
((cond-expand (srfi-2 body ...) more-clauses ...)
((cond-expand (srfi-2 body ...) more-clauses ...)
(begin body ...))
((cond-expand (srfi-4 body ...) more-clauses ...)
((cond-expand (srfi-4 body ...) more-clauses ...)
(begin body ...))
((cond-expand (srfi-6 body ...) more-clauses ...)
((cond-expand (srfi-6 body ...) more-clauses ...)
(begin body ...))
((cond-expand (srfi-10 body ...) more-clauses ...)
((cond-expand (srfi-10 body ...) more-clauses ...)
(begin body ...))
((cond-expand (srfi-22 body ...) more-clauses ...)
((cond-expand (srfi-22 body ...) more-clauses ...)
(begin body ...))
((cond-expand (srfi-23 body ...) more-clauses ...)
((cond-expand (srfi-23 body ...) more-clauses ...)
(begin body ...))
((cond-expand (srfi-46 body ...) more-clauses ...)
((cond-expand (srfi-46 body ...) more-clauses ...)
(begin body ...))
((cond-expand (srfi-176 body ...) more-clauses ...)
((cond-expand (srfi-139 body ...) more-clauses ...)
(begin body ...))
((cond-expand (lips body ...) more-clauses ...)
((cond-expand (srfi-176 body ...) more-clauses ...)
(begin body ...))
((cond-expand (lips body ...) more-clauses ...)
(begin body ...))
((cond-expand (complex body ...) more-clauses ...)
(begin body ...))
Expand All @@ -597,11 +600,19 @@
((cond-expand (exact-complex body ...) more-clauses ...)
(begin body ...))
((cond-expand (full-numeric-tower body ...) more-clauses ...)
(begin body ...))))
(begin body ...))
((cond-expand (skip body ...) more-clauses ...)
(cond-expand more-clauses ...)))
"(cond-expand (cond body ...)
Conditionally execute code based on a features by Scheme implementation.")

;; -----------------------------------------------------------------------------
(define (features)
'(r7rs srfi-0 srfi-2 srfi-4 srfi-6 srfi-10 srfi-22 srfi-23 srfi-46 srfi-176 lips
"(features)

Function returns implemented features as a list."
'(r7rs srfi-0 srfi-2 srfi-4 srfi-6 srfi-10 srfi-22 srfi-23 srfi-46 srfi-139 srfi-176 lips
complex full-unicode ieee-float ratios exact-complex full-numeric-tower))

;; -----------------------------------------------------------------------------
Expand Down

0 comments on commit 454969c

Please sign in to comment.