Skip to content

Commit aacc0cd

Browse files
forward progress
1 parent 0c585a6 commit aacc0cd

File tree

4 files changed

+19
-1
lines changed

4 files changed

+19
-1
lines changed

SRC/std-apply-macro-candidates.lsts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ let std-apply-macro-candidates(tctx: TContext?, mname: CString, margs: AST, cand
99
let t = ASTEOF;
1010
for Tuple{ctype=first, second:Abs{mlhs=lhs,rhs:App{left:Lit{key:c":"},right:App{mrhs=left}}}} in candidates {
1111
if not(non-zero(t)) {
12+
print("Apply Candidate \{mname}\nLeft: \{mlhs}\nRight: \{margs}\n");
1213
(let new-tctx, let mctx) = std-try-destructure-macro(tctx, margs, ctype, mlhs);
1314
if mctx.is-some then mctx = union(mctx, Some{extract-uuids(mrhs)});
1415
if mctx.is-some then t = with-location-preserve(substitute(mctx.get-or-panic, mrhs), margs.location);

SRC/std-destructure-macro.lsts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
let std-destructure-macro(lhs: AST, rhs: AST): AContext? = (
3+
let no = None :: AContext?;
4+
match (lhs, rhs) {
5+
_ => fail("Unexpected std-destructure-macro\nLeft: \{lhs}\nRight: \{rhs}\n");
6+
};
7+
no
8+
);
9+

SRC/std-direct-destructure-macro.lsts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ let std-direct-destructure-macro(margs: AST, mstruct: AST): AContext? = (
33
let no = None :: AContext?;
44
match (margs, mstruct) {
55
Tuple{ val=first, second:Var{key=key} } => Some{[(key,val)]};
6-
_ => no;
6+
Tuple{
7+
first:App{is-cons:1_u8, lrest=left, val=right },
8+
second:App{is-cons:1_u8, rrest=left, right:Var{key=key} }
9+
} => (
10+
let ctx = std-direct-destructure-macro(lrest, rrest);
11+
if ctx.is-some then Some{cons((key,val), ctx.get-or-panic)} else no;
12+
);
13+
_ => fail("Unexpected std-direct-destructure-macro\nLeft: \{mstruct}\nRight: \{margs}\n");
714
}
815
);

SRC/unit-orphans.lsts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ let .unroll-seq(t: AST): Vector<AST> = (
2424
_ => mk-vector(type(AST));
2525
}
2626
);
27+

0 commit comments

Comments
 (0)