File tree 10 files changed +9670
-9785
lines changed
10 files changed +9670
-9785
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " lambda_mountain"
3
- version = " 1.11.93 "
3
+ version = " 1.11.94 "
4
4
authors = [" Andrew <andrew@subarctic.org>" ]
5
5
license = " MIT"
6
6
description = " Lambda Mountain"
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ assemble := λprogram . (
37
37
(typecheck-ascript( (GlobalVariable 'argc) (parse-type 'U64+GlobalVariable) ))
38
38
)))
39
39
(set global_ctx (context::bind( global_ctx 'argv
40
- (typecheck-ascript( (GlobalVariable 'argv) (parse-type 'U8[?] [?]+GlobalVariable) ))
40
+ (typecheck-ascript( (GlobalVariable 'argv) (parse-type 'String [?]+GlobalVariable) ))
41
41
)))
42
42
(set assemble-argv-referenced True)
43
43
(set preview_program pc)
Original file line number Diff line number Diff line change @@ -89,10 +89,8 @@ compile-expr-strict := λctx e offset used . (tail(
89
89
(match (typecheck-slot( (typecheck-lookup r) Array )) (
90
90
()
91
91
( (Array( x '? )) (
92
- (if (typecheck-unify-implies( x U8 )) () (
93
- (if (typecheck-unify-implies( x '? )) () (
94
- (set deref True)
95
- ))
92
+ (if (typecheck-unify-implies( x '? )) () (
93
+ (set deref True)
96
94
))
97
95
))
98
96
))
@@ -243,7 +241,7 @@ compile-expr-strict := λctx e offset used . (tail(
243
241
)))
244
242
( (App( (App( (Literal :) (Literal lval) )) ltype )) (tail(
245
243
(set ltype (typecheck-infer-type-compound ltype))
246
- (if (typecheck-unify-args( (Array( U8 '? )) ltype )) (
244
+ (if (typecheck-unify-args( String ltype )) (
247
245
(local uid)
248
246
(set uid (strict-declare-cstring( lval )))
249
247
(set e1 (expr::set-expr( (expr::new ()) uid )))
@@ -268,7 +266,7 @@ compile-expr-strict := λctx e offset used . (tail(
268
266
e1
269
267
)))
270
268
( (Literal lval) (tail(
271
- (if (typecheck-unify-args( (Array( U8 '? )) (typecheck-lookup e) )) (
269
+ (if (typecheck-unify-args( String (typecheck-lookup e) )) (
272
270
(local uid)
273
271
(set uid (strict-declare-cstring( lval )))
274
272
(set e1 (expr::set-expr( (expr::new ()) uid )))
Original file line number Diff line number Diff line change @@ -658,7 +658,7 @@ typecheck-infer-type-expr := λe . (match e (
658
658
))
659
659
( (Global( 'main (Lambda( _ _ )) )) (tail(
660
660
(set typecheck-global-context ( typecheck-global-context (Global( 'argc (parse-type 'U64+GlobalVariable) )) ))
661
- (set typecheck-global-context ( typecheck-global-context (Global( 'argv (parse-type 'U8[?] [?]+GlobalVariable) )) ))
661
+ (set typecheck-global-context ( typecheck-global-context (Global( 'argv (parse-type 'String [?]+GlobalVariable) )) ))
662
662
)))
663
663
( (Global( gln (Lambda( glp (App( (App( (Literal ':) _ )) rtype )) )) )) (tail(
664
664
(local lt)
@@ -820,10 +820,8 @@ typecheck-infer-expr := λctx e used . (tail(
820
820
(match (typecheck-slot( (typecheck-lookup r) Array )) (
821
821
()
822
822
( (Array( x '? )) (
823
- (if (typecheck-unify-implies( x U8 )) () (
824
- (if (typecheck-unify-implies( x '? )) () (
825
- (set rtype x)
826
- ))
823
+ (if (typecheck-unify-implies( x '? )) () (
824
+ (set rtype x)
827
825
))
828
826
))
829
827
))
Original file line number Diff line number Diff line change @@ -189,7 +189,7 @@ fragment mov := λ(: src Reg16)(: dst LocalVariable). (: (.program( \t 'mov \s '
189
189
fragment mov := λ(: src Reg32)(: dst LocalVariable). (: (.program( \t 'mov \s '% (.expression src) , \s (.expression dst) \[ '%rbp \] \n )) Nil);
190
190
fragment mov := λ(: src Reg64)(: dst LocalVariable). (: (.program( \t 'mov \s '% (.expression src) , \s (.expression dst) \[ '%rbp \] \n )) Nil);
191
191
192
- fragment mov := λ(: src Constant+U8[] )(: dst LocalVariable). (: (.program(
192
+ fragment mov := λ(: src Constant+String )(: dst LocalVariable). (: (.program(
193
193
\t 'movq \s '$ (.expression src) , \s (.expression dst) \[ '%rbp \] \n
194
194
)) Nil);
195
195
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ fragment type I8; size I8 1; atom suffix I8 i8;
7
7
fragment type I16; size I16 2; atom suffix I16 i16;
8
8
fragment type I32; size I32 4; atom suffix I32 i32;
9
9
fragment type I64; size I64 8; atom suffix I64 i64;
10
- atom suffix U8[] _s;
10
+ size String 8; atom suffix String _s;
11
11
12
12
fragment [] := λ(: l GlobalVariable+Array<x,?>)(: r GlobalVariable+U64). (: (
13
13
(.program (
Original file line number Diff line number Diff line change 1
1
2
2
type S (SNil)
3
- | (SAtom( U8[] ))
3
+ | (SAtom( String ))
4
4
| (SCons( S[] , S[] ))
5
5
| (SPointer( ?[] ));
6
6
@@ -31,7 +31,7 @@ print := λ(: x S). (: (tail(
31
31
()
32
32
)) Nil);
33
33
34
- fail := λ(: msg Array<U8,?> ). (: (tail(
34
+ fail := λ(: msg String ). (: (tail(
35
35
(print msg)
36
36
(exit 1u64)
37
37
)) Nil);
@@ -42,7 +42,7 @@ exit := λ(: code U64). (: (tail(
42
42
(syscall())
43
43
)) Nil);
44
44
45
- print := λ(: x Array<U8,?> ). (: (tail(
45
+ print := λ(: x String ). (: (tail(
46
46
(mov( x R15 ))
47
47
(mov( 0u64 RDX )) # data length
48
48
(gensym-label begin-count)
@@ -176,7 +176,7 @@ print := λ(: x I8). (: (tail(
176
176
(print( (: R15 Reg64+I64) ))
177
177
)) Nil);
178
178
179
- == := λ(: l U8[] )(: r U8[] ). (: (tail(
179
+ == := λ(: l String )(: r String ). (: (tail(
180
180
(let c1 0u8)
181
181
(let c2 0u8)
182
182
(gensym-label start)
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ config-target := 'tmp.s_s;
22
22
type CompileMode ModeTokenize | ModeParse | ModePreprocess | ModeTypecheck | ModeCompile;
23
23
config-mode := (: ModeCompile CompileMode);
24
24
25
- main := λ(: argc U64)(: argv U8[] []).(tail(
25
+ main := λ(: argc U64)(: argv String []).(tail(
26
26
(let argi 1u64)
27
27
(let input SNil)
28
28
(while (<( argi argc )) (
Original file line number Diff line number Diff line change 1
1
2
2
type Tokens EOF;
3
3
4
- tokenize := λ(: fp U8[] ). (: (tail(
4
+ tokenize := λ(: fp String ). (: (tail(
5
5
()
6
6
()
7
7
)) Nil);
You can’t perform that action at this time.
0 commit comments