@@ -6,37 +6,42 @@ import STDLIB/default-stdlib.lm;
66
77import STRICT/utility.lm;
88
9- config-strict := 0u8;
9+ #config-strict := True;
10+ #config-preprocess := True;
11+ #config-target := 'tmp.s_s;
1012
11- type CompileMode Tokenize | Parse | Compile ;
12- config-mode := Compile ;
13+ type CompileMode ModeTokenize | ModeParse | ModeTypecheck | ModeCompile ;
14+ config-mode := ModeCompile ;
1315
1416main := λ(: argc U64)(: argv U8[][]).(tail(
15- # (let argi 0u64)
17+ (let argi 0u64)
1618 (let input SNil)
17- (set input (SCons(
18- (close SNil)
19- (close SNil)
20- )))
21- # (while (<( argi argc )) (
22- # (set input (SNil))
23- # (set input (SCons(
24- # (close (SAtom(
25- # ([]( argv argi ))
19+ (while (<( argi argc )) (
20+ (print 'c_s)
21+ (match ([]( argv argi )) (
22+ ()
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+ # )))
2638# )))
27- # (close input)
28- # )))
29- # (set argi (+( argi 1u64 )))
30- # ))
39+ # (fp (set input (SCons(
40+ # (close input)
41+ # (close (SAtom( fp )))
42+ # ))))
43+ ))
44+ (set argi (+( argi 1u64 )))
45+ ))
3146 (print input)
32- # (print (==( ([]( argv argi )) (: '--tokenize U8[]) )) )
33- # if set_target { config_target().lock().unwrap().set(arg); }
34- # else if arg=="--tokenize" {unsafe{ CONFIG_MODE = CompileMode::Tokenize; }}
35- # else if arg=="--parse" {unsafe{ CONFIG_MODE = CompileMode::Parse; }}
36- # else if arg=="--typecheck" {unsafe{ CONFIG_MODE = CompileMode::Typecheck; }}
37- # else if arg=="--compile" {unsafe{ CONFIG_MODE = CompileMode::Compile; }}
38- # else if arg=="--strict" {unsafe{ CONFIG_STRICT = true; }}
39- # else if arg=="--gradual" {unsafe{ CONFIG_STRICT = false; }}
40- # else if arg=="--noprep" {unsafe{ CONFIG_PREPROCESS = false; }}
41- # else if arg=="-o" { set_target = true; }
4247));
0 commit comments