Skip to content

Commit e2c4bb4

Browse files
pointer to wrong def
1 parent 040c236 commit e2c4bb4

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

PLATFORM/C/LIB/common-macros.lsts

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

2-
#typed macro macro::let(lhs: lazy, rhs: lazy): lazy = (
3-
# (fn(lhs) = ()) (rhs)
4-
#);
2+
typed macro macro::let(lhs: lazy, rhs: lazy): lazy = (
3+
(fn(lhs) = ()) (rhs)
4+
);
55

66
typed macro macro::for(item: lazy, iter: List<?>, loop: lazy): lazy = (
77
let uuid(iter-term) = iter;

PLUGINS/FRONTEND/LSTS/lsts-parse.lsts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,16 +1061,16 @@ let lsts-parse-small-expression(tokens: List<Token>): Tuple<AST,List<Token>> = (
10611061
lsts-parse-expect(c"=", tokens); tokens = tail(tokens);
10621062
let rhs-rest = lsts-parse-small-expression(tokens);
10631063
tokens = rhs-rest.second;
1064-
#base = mk-app(
1065-
# mk-var(with-location(mk-token("macro::let"),loc)),
1066-
# mk-cons(lhs-rest.first, rhs-rest.first)
1067-
#);
10681064
base = mk-app(
1069-
mk-app(
1070-
mk-var(with-location(mk-token("let"),loc)),
1071-
lhs-rest.first
1072-
), rhs-rest.first
1065+
mk-var(with-location(mk-token("macro::let"),loc)),
1066+
mk-cons(lhs-rest.first, rhs-rest.first)
10731067
);
1068+
#base = mk-app(
1069+
# mk-app(
1070+
# mk-var(with-location(mk-token("let"),loc)),
1071+
# lhs-rest.first
1072+
# ), rhs-rest.first
1073+
#);
10741074
);
10751075
[Token{key:c"while"}.. rest] => (
10761076
let loc = head(tokens).location; tokens = rest;

SRC/std-apply-macro-candidates.lsts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ let std-apply-macro-candidates(tctx: TContext?, mname: CString, margs: AST, cand
1111
if not(non-zero(t)) {
1212
(let new-tctx, let mctx) = std-try-destructure-macro(tctx, margs, ctype, mlhs);
1313
if mctx.is-some then mctx = union(mctx, Some{extract-uuids(mrhs)});
14-
if mctx.is-some then t = with-location(substitute(mctx.get-or-panic, mrhs.unique), margs.location);
14+
if mctx.is-some then t = with-location(substitute(mctx.get-or-panic, mrhs), margs.location);
1515
}
1616
};
1717
if not(non-zero(t)) then fail("Macro Application failed match during destructuring: \{mname}\n");
18-
print("Applied Macro: \{mname}\nTerm: \{t}\n");
1918
(tctx, t) = std-infer-expr(tctx, t, false, Used, TAny);
2019
(tctx, t)
2120
);

SRC/std-infer-expr.lsts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
7070
(_, let new-t) = std-infer-expr(tctx-inner, t, false, Tail, TAny);
7171
(_, let new-f) = std-infer-expr(tctx, f, false, Tail, TAny);
7272
if not(is(cond,new-cond)) || not(is(t,new-t)) || not(is(f,new-f))
73-
then { term = mk-app(mk-app(mk-app(ifv,new-cond),new-t),new-f) };
73+
then { cond = new-cond; t = new-t; f = new-f; term = mk-app(mk-app(mk-app(ifv,new-cond),new-t),new-f) };
7474
} else {
7575
(tctx, let new-cond) = std-infer-expr(tctx, cond, false, Used, TAny);
7676
(let tctx-t, let new-t) = std-infer-expr(tctx, t, false, Tail, TAny);
7777
(_, let new-f) = std-infer-expr(tctx, f, false, Tail, TAny);
7878
tctx = tctx-t;
7979
if not(is(cond,new-cond)) || not(is(t,new-t)) || not(is(f,new-f))
80-
then { term = mk-app(mk-app(mk-app(ifv,new-cond),new-t),new-f) };
80+
then { cond = new-cond; t = new-t; f = new-f; term = mk-app(mk-app(mk-app(ifv,new-cond),new-t),new-f) };
8181
};
8282
ascript-normal(term, typeof(t)); # TODO: use MGU to merge true and false branches
8383
);

0 commit comments

Comments
 (0)