Skip to content

Commit 44e3c94

Browse files
some bug, but close
1 parent 425d591 commit 44e3c94

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

PLUGINS/FRONTEND/LSTS/lsts-parse.lsts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ let lsts-parse(tokens: List<Token>): Nil = (
262262

263263
let lsts-parse-top-level(tokens: List<Token>): Tuple<AST,List<Token>> = (
264264
# TODO, accept all top-level expressions here
265-
lsts-parse-small-expression(tokens);
265+
lsts-parse-expression(tokens);
266266
);
267267

268268
let lsts-parse-typed-macro(tokens: List<Token>): (AST, List<Token>) = (
@@ -1353,10 +1353,7 @@ let lsts-parse-lhs-one(tokens: List<Token>): Tuple<AST,List<Token>> = (
13531353
let base-rest = lsts-parse-lhs-one(tokens);
13541354
tokens = base-rest.second;
13551355
lsts-parse-expect(c")", tokens); tokens = tail(tokens);
1356-
mk-cons(
1357-
Var{ u.key, u },
1358-
base-rest.first
1359-
);
1356+
mk-cons( Var{ u.key, u }, base-rest.first );
13601357
} else if lsts-is-ident-head(lsts-parse-head(tokens)) {
13611358
let base-rest = lsts-make-maybe-var(tokens);
13621359
tokens = base-rest.second;

SRC/std-infer-expr.lsts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ let std-infer-expr(tctx: Maybe<TContext>, term: AST, is-scoped: Bool, used: IsUs
152152

153153
if index-macro-table.has(var-name-if-var(l)) {
154154
(tctx, term) = std-apply-macro(tctx, term);
155+
print("Applied Macro: \{var-name-if-var(l)}\nTerm: \{term}\n");
155156
} else {
156157
(tctx, let new-l) = std-infer-expr(tctx, l, false, used, TAny);
157158
if typeof(l).is-arrow {

tests/unit/ast-macros.lsts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ typed macro macro::for(item: lazy, iter: List<?>, loop: lazy): lazy = (
1919
);
2020
}}
2121
);
22+
23+
$"macro::for"(x, [1, 2], print(x));

0 commit comments

Comments
 (0)