Skip to content

Commit f994530

Browse files
revert to a working version
1 parent 0f4b781 commit f994530

File tree

5 files changed

+10
-28
lines changed

5 files changed

+10
-28
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
nostd: prod
3-
./production --nostd -o tmp.s tests/strict/match4.lm
3+
./production --nostd -o tmp.s tests/strict/printU64.lm
44
as -o tmp.o tmp.s
55
ld -o tmp tmp.o
66
./tmp && echo $?

PRODUCTION/preprocess.lm

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

2-
preprocess := λ program . (tail(
3-
(preprocess-typecheck program)
2+
preprocess := λprogram . (tail(
3+
()
44
(preprocess-apply-macros program)
55
));
66

@@ -53,16 +53,7 @@ try-destructure-macro := λlhs e . (match (lhs e) (
5353
(if (eq( pl el )) Accept ())
5454
))
5555
( ( (App( (Literal :Literal:) (Variable pv) )) (Literal el)) (
56-
(if (typecheck-is-constructor el)
57-
()
58-
(Accept (KV( pv e )))
59-
)
60-
))
61-
( ( (App( (Literal :Tag:) (Variable pv) )) (Literal el)) (
62-
(if (typecheck-is-constructor el)
63-
(Accept (KV( pv (typecheck-is-constructor el) )))
64-
()
65-
)
56+
(Accept (KV( pv e )))
6657
))
6758
( ( (App( (Literal :Variable:) (Variable pv) )) (Variable el)) (
6859
(Accept (KV( pv e )))

PRODUCTION/typecheck.lm

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ typecheck-global-context := ();
77
typecheck-size := ();
88
typecheck-fragment-types := ();
99

10-
preprocess-typecheck := λprogram . (tail(
10+
typecheck := λprogram . (tail(
1111
(local p)
1212
(set p program)
1313
(local ordered-type-exprs)
@@ -20,9 +20,6 @@ preprocess-typecheck := λprogram . (tail(
2020
(typecheck-infer-type-expr( (tail ordered-type-exprs) ))
2121
(set ordered-type-exprs (head ordered-type-exprs))
2222
))
23-
));
24-
25-
typecheck := λprogram . (tail(
2623
(set typecheck-types-have-changed True)
2724
(while typecheck-types-have-changed (
2825
(set typecheck-types-have-changed ())
@@ -768,21 +765,15 @@ typecheck-infer-expr := λctx e used . (tail(
768765
))
769766
) ())
770767
))
771-
( (Literal True) (tail(
772-
(typecheck-ascript( e (And( U8 (And( Literal Constant )) )) ))
773-
)))
774-
( (Literal False) (tail(
775-
(typecheck-ascript( e (And( U8 (And( Literal Constant )) )) ))
776-
)))
777-
( (Literal lit) (tail(
768+
( (Literal lit) (
778769
(local ctype)
779770
(set ctype (typecheck-infer-constructor-type lit))
780771
(if ctype (
781772
(typecheck-ascript( e (And( (And( lit ctype )) Constant )) ))
782773
) (
783774
(typecheck-ascript( e Atom ))
784775
))
785-
)))
776+
))
786777
( (App( (App( (Variable 'set) (Variable lhs) )) rhs )) (tail(
787778
(typecheck-infer-expr( ctx rhs Used ))
788779
(typecheck-ascript( e Nil ))

STDLIB/default-rules.lm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ macro ('match-pats-condition term (:Literal: l)) (
2727
(==( term l ))
2828
);
2929

30-
macro ('match-pats-condition term (:Tag: l)) (
31-
(==( (.0( term )) l ))
32-
);
30+
#macro ('match-pats-condition term (:Tag: l)) (
31+
# (==( (.0( term )) l ))
32+
#);
3333

tests/strict/match4.lm.out

Whitespace-only changes.

0 commit comments

Comments
 (0)