Commit aa67c9cb authored by Per Bothner's avatar Per Bothner

* lang/BindDecls.java: Fix match for nested literal.

* match1.scm: Test for match for nested literal.
parent e85ee67c
Pipeline #161852404 failed with stage
in 5 minutes and 36 seconds
2020-06-30 Per Bothner <per@bothner.com>
* lang/BindDecls.java: Fix match for nested literal.
2020-06-15 Per Bothner <per@bothner.com>
* standard/make.java: Explicitly import kawa.lang.Record.
......
......@@ -63,7 +63,7 @@ public class BindDecls {
}
/** Parse a declaration or more generally a pattern.
* The actual pattern is an initial sublist (using just the initial
* The actual pattern is an initial sublist (usually just the initial
* car) of the patList.
* @return A 2-element array, where element 0 is the unused remainder
* of patList, while element 1 is a Declaration for that pattern.
......@@ -111,6 +111,8 @@ public class BindDecls {
QuoteExp literal = literalPattern(patval, comp);
if (literal != null) {
decl = scope.addDeclaration((Object) null);
if (init != null)
setInitializer(decl, init, scope, comp);
addCondition(scope, compareLiteral(decl, literal));
} else if (patval instanceof Symbol) {
if (patval == underScoreSymbol) {
......
2020-06-30 Duncan Mak <duncanmak@gmail.com>
* match1.scm: Test for match for nested literal.
2020-03-18 Per Bothner <per@bothner.com>
* formatst.scm: New tests, mainly srfi-48.
......
......@@ -112,3 +112,6 @@
(newline)
;; Output: match#2: ((double 3.4) (double 0.0) (pos-integer 12) (list (a b)) (other (a c)) (other str) (neg-integer -3) (zero-integer))
(format #t "match-seq-quote <~s>~%"
(match '(foo 1 2) (['foo a b] (+ a b))))
;; Output: match-seq-quote <3>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment