Skip to content

Commit 3951793

Browse files
Merge pull request #215 from andrew-johnson-4/strict-compiler-dev-2-2
Strict compiler dev 2 2
2 parents b1a0c4a + 6560448 commit 3951793

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

Cargo.toml

+1-1
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

+7
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

+13-2
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,22 @@ macro ('match t ps) (tail(
77
(match-pats( (uuid term) ps (fail PatternMatchFailure_s) ))
88
));
99

10-
macro ('match-pats( term ps remainder )) (
10+
macro ('match-pats( term () remainder )) (
1111
remainder
1212
);
1313

14-
#macro ('match-pats( term matched return () )) ();
14+
macro ('match-pats( term (ps (lhs rhs)) 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())
24+
);
25+
1526
#macro ('match-pats( term matched return (ps (lhs rhs)) )) (
1627
# (match-pats( term matched return ps ))
1728
# (if matched () (

tests/lm/macro5.lm

-9
This file was deleted.

tests/lm/macro5.lm.out

-1
This file was deleted.

0 commit comments

Comments
 (0)