Skip to content

Commit 6560448

Browse files
fix broken test case with correct output
1 parent 989eb9a commit 6560448

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lambda_mountain"
3-
version = "1.11.77"
3+
version = "1.11.78"
44
authors = ["Andrew <andrew@subarctic.org>"]
55
license = "MIT"
66
description = "Lambda Mountain"

STDLIB/default-primitives.lm

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ fragment < := λ(: l LocalVariable+U64)(: r GlobalVariable+U64). (: (
8282
(.expression( 'jb ))
8383
) BranchConditional);
8484

85+
fragment branchtrue := λ(: _ Nil). (: (
86+
(.expression( 'jmp ))
87+
) BranchConditional);
88+
fragment branchfalse := λ(: _ Nil). (: (
89+
(.expression( 'nop ))
90+
) BranchConditional);
91+
8592
fragment + := λ(: l LocalVariable+U8)(: r LocalVariable+U8). (: (
8693
(.program(
8794
\t 'mov \s (.expression l) \[ '%rbp \] , \s '%al \n

STDLIB/default-rules.lm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,15 @@ macro ('match-pats( term () remainder )) (
1212
);
1313

1414
macro ('match-pats( term (ps (lhs rhs)) remainder )) (
15-
remainder
15+
(match-pats(
16+
term
17+
ps
18+
(if (match-pats-condition lhs) rhs remainder)
19+
))
20+
);
21+
22+
macro ('match-pats-condition any) (
23+
(branchtrue())
1624
);
1725

1826
#macro ('match-pats( term matched return (ps (lhs rhs)) )) (

tests/lm/macro5.lm

Lines changed: 0 additions & 9 deletions
This file was deleted.

tests/lm/macro5.lm.out

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)