Skip to content

Commit 143275d

Browse files
next is a macro for match
1 parent ce3456a commit 143275d

File tree

4 files changed

+37
-23
lines changed

4 files changed

+37
-23
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 STRICT/cli.lm
3+
./production --nostd -o tmp.s tests/strict/match1.lm
44
as -o tmp.o tmp.s
55
ld -o tmp tmp.o
66
./tmp && echo $?

STRICT/cli.lm

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import STDLIB/default-stdlib.lm;
66

77
import STRICT/utility.lm;
88

9-
config-strict := True;
10-
config-preprocess := True;
11-
config-target := 'tmp.s_s;
9+
#config-strict := True;
10+
#config-preprocess := True;
11+
#config-target := 'tmp.s_s;
1212

1313
type CompileMode ModeTokenize | ModeParse | ModeTypecheck | ModeCompile;
1414
config-mode := ModeCompile;
@@ -17,27 +17,29 @@ main := λ(: argc U64)(: argv U8[][]).(tail(
1717
(let argi 0u64)
1818
(let input SNil)
1919
(while (<( argi argc )) (
20+
(print 'c_s)
2021
(match ([]( argv argi )) (
2122
()
22-
('--tokenize_s (set config-mode ModeTokenize))
23-
('--parse_s (set config-mode ModeParse))
24-
('--typecheck_s (set config-mode ModeTypecheck))
25-
('--compile_s (set config-mode ModeCompile))
26-
('--strict_s (set config-strict True))
27-
('--gradual_s (set config-strict False))
28-
('--macro_s (set config-preprocess True))
29-
('--nomacro_s (set config-preprocess False))
30-
('-o_s (tail(
31-
(set argi (+( argi 1u64 )))
32-
(set input (SCons(
33-
(close input)
34-
(close (SAtom([]( argv argi ))))
35-
)))
36-
)))
37-
(fp (set input (SCons(
38-
(close input)
39-
(close (SAtom( fp )))
40-
))))
23+
# (_ (print c_s))
24+
# ('--tokenize_s (set config-mode ModeTokenize))
25+
# ('--parse_s (set config-mode ModeParse))
26+
# ('--typecheck_s (set config-mode ModeTypecheck))
27+
# ('--compile_s (set config-mode ModeCompile))
28+
# ('--strict_s (set config-strict True))
29+
# ('--gradual_s (set config-strict False))
30+
# ('--macro_s (set config-preprocess True))
31+
# ('--nomacro_s (set config-preprocess False))
32+
# ('-o_s (tail(
33+
# (set argi (+( argi 1u64 )))
34+
# (set input (SCons(
35+
# (close input)
36+
# (close (SAtom([]( argv argi ))))
37+
# )))
38+
# )))
39+
# (fp (set input (SCons(
40+
# (close input)
41+
# (close (SAtom( fp )))
42+
# ))))
4143
))
4244
(set argi (+( argi 1u64 )))
4345
))

tests/strict/match1.lm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
import STDLIB/default-instruction-set.lm;
3+
import STDLIB/default-primitives.lm;
4+
import STDLIB/default-rules.lm;
5+
import STDLIB/default-stdlib.lm;
6+
7+
main := match 1u64 (
8+
()
9+
(1u64 (print 1u64))
10+
(_ (print 0u64))
11+
);

tests/strict/match1.lm.out

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

0 commit comments

Comments
 (0)