Skip to content

Commit 2ab0597

Browse files
just need to look at diff
1 parent 872a611 commit 2ab0597

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CC = cc
2-
CFLAGS = -O3 -march=native -mtune=native
2+
CFLAGS = -O3 -march=native -mtune=native -ferror-limit=50
33

44
dev: install-production
55
lm t.lsts

PLUGINS/BACKEND/C/compile-global.lm

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ compile-global-c-main-term := ASTEOF;
99

1010
compile-global-c := λ(: ctx FContext)(: k String)(: term AST). (: (
1111
(let kt (typeof term))
12+
(print 'Global\s_s)(print k)(print '\s:\s_s)(print kt)(print '\n_s)
1213
(match term (
1314
()
1415
( (Abs( lhs rhs tlt )) (

PLUGINS/BACKEND/C/std-c-compile-call.lsts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ let std-c-compile-call(ctx: FContext, fname: CString, fterm: AST, args: AST): Fr
1616
let push-args = std-c-compile-push-args(ctx, args);
1717
let function-id = if typeof(fterm).is-t(c"FFI") || typeof(fterm).is-t(c"C-FFI")
1818
then fname else mangle-identifier(fname, typeof(fterm));
19+
print("Call \{fname} : \{typeof(fterm)}\n");
1920
let ictx = mk-fragment().set(c"function-id", SAtom{function-id});
2021
let inner-ctx = mk-fctx().bind(c"ictx", t1(c"ImplicitContext"), ictx)
2122
.bind(c"args", typeof(args), push-args);

SRC/std-infer-expr.lsts

+4-2
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,11 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
130130
ascript-normal(term, t3(c"Arrow", typeof-lhs(lhs), return-type) && misc-tt);
131131
);
132132
App{ is-cons=is-cons, l=left, r=right } => (
133+
let is-macro = false;
133134
if is-cons {
134135
(tctx, let new-l) = std-infer-expr(tctx, l, false, Used, TAny);
135136
(tctx, let new-r) = std-infer-expr(tctx, r, false, Used, TAny);
136-
if not(is(l,new-l)) || not(is(r,new-r)) then { term = mk-cons(new-l, new-r) };
137+
if not(is(l,new-l)) || not(is(r,new-r)) then { l = new-l; r = new-r; term = mk-cons(new-l, new-r) };
137138
ascript-normal(term, if is(used, Tail) then typeof(r) else t3(c"Cons", typeof(l), typeof(r)));
138139
} else {
139140
let rt = TAny;
@@ -156,6 +157,7 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
156157

157158
if index-macro-table.has(var-name-if-var(l)) {
158159
(tctx, term) = std-apply-macro(tctx, term);
160+
is-macro = true;
159161
} else {
160162
(tctx, let new-l) = std-infer-expr(tctx, l, false, used, TAny);
161163
if typeof(l).is-arrow {
@@ -175,7 +177,7 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
175177
};
176178
};
177179

178-
if not(index-macro-table.has(var-name-if-var(l))) && not(is-cons) && non-zero(var-name-if-var(l)) && typeof(l).is-arrow {
180+
if not(is-macro) && not(is-cons) && non-zero(var-name-if-var(l)) && typeof(l).is-arrow {
179181
mark-var-to-def-todo(tctx, var-name-if-var(l), typeof(r), l);
180182
};
181183
);

0 commit comments

Comments
 (0)