mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Fixing bug in match for var extraction of quasiquote patterns.
This commit is contained in:
parent
7d697c29c0
commit
b1243c63d4
2 changed files with 7 additions and 4 deletions
|
@ -33,6 +33,8 @@
|
||||||
(match '(ok . ok) ((x . 'bad) x) (('ok . x) x)))
|
(match '(ok . ok) ((x . 'bad) x) (('ok . x) x)))
|
||||||
(test "duplicate symbols bound" 3
|
(test "duplicate symbols bound" 3
|
||||||
(let ((a '(1 2))) (match a ((and (a 2) (1 b)) (+ a b)) (_ #f))))
|
(let ((a '(1 2))) (match a ((and (a 2) (1 b)) (+ a b)) (_ #f))))
|
||||||
|
(test "duplicate quasiquote" 'ok
|
||||||
|
(match '(a b) ((or `(a ,x) `(,x b)) 'ok) (_ #f)))
|
||||||
|
|
||||||
(test "ellipses" '((a b c) (1 2 3))
|
(test "ellipses" '((a b c) (1 2 3))
|
||||||
(match '((a . 1) (b . 2) (c . 3))
|
(match '((a . 1) (b . 2) (c . 3))
|
||||||
|
|
|
@ -227,6 +227,7 @@
|
||||||
;; performance can be found at
|
;; performance can be found at
|
||||||
;; http://synthcode.com/scheme/match-cond-expand.scm
|
;; http://synthcode.com/scheme/match-cond-expand.scm
|
||||||
;;
|
;;
|
||||||
|
;; 2015/05/09 - fixing bug in var extraction of quasiquote patterns
|
||||||
;; 2014/11/24 - adding Gauche's `@' pattern for named record field matching
|
;; 2014/11/24 - adding Gauche's `@' pattern for named record field matching
|
||||||
;; 2012/12/26 - wrapping match-let&co body in lexical closure
|
;; 2012/12/26 - wrapping match-let&co body in lexical closure
|
||||||
;; 2012/11/28 - fixing typo s/vetor/vector in largely unused set! code
|
;; 2012/11/28 - fixing typo s/vetor/vector in largely unused set! code
|
||||||
|
@ -808,13 +809,13 @@
|
||||||
(match-extract-vars x k i v))
|
(match-extract-vars x k i v))
|
||||||
((match-extract-quasiquote-vars (unquote x) k i v (#t . d))
|
((match-extract-quasiquote-vars (unquote x) k i v (#t . d))
|
||||||
(match-extract-quasiquote-vars x k i v d))
|
(match-extract-quasiquote-vars x k i v d))
|
||||||
((match-extract-quasiquote-vars (x . y) k i v (#t . d))
|
((match-extract-quasiquote-vars (x . y) k i v d)
|
||||||
(match-extract-quasiquote-vars
|
(match-extract-quasiquote-vars
|
||||||
x
|
x
|
||||||
(match-extract-quasiquote-vars-step y k i v d) i ()))
|
(match-extract-quasiquote-vars-step y k i v d) i () d))
|
||||||
((match-extract-quasiquote-vars #(x ...) k i v (#t . d))
|
((match-extract-quasiquote-vars #(x ...) k i v d)
|
||||||
(match-extract-quasiquote-vars (x ...) k i v d))
|
(match-extract-quasiquote-vars (x ...) k i v d))
|
||||||
((match-extract-quasiquote-vars x (k ...) i v (#t . d))
|
((match-extract-quasiquote-vars x (k ...) i v d)
|
||||||
(k ... v))
|
(k ... v))
|
||||||
))
|
))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue