Skip to content

Commit

Permalink
fixed missing rib and added test
Browse files Browse the repository at this point in the history
  • Loading branch information
azizghuloum committed Nov 25, 2024
1 parent 87138e6 commit 676cb2d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/AST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type list_tag =
| "program"
| "lexical_declaration"
| "variable_declarator"
| "export_statement"
| "binary_expression"
| "unary_expression"
| "call_expression"
Expand All @@ -48,6 +49,7 @@ export const list_tags: { [k in list_tag]: list_tag } = {
program: "program",
lexical_declaration: "lexical_declaration",
variable_declarator: "variable_declarator",
export_statement: "export_statement",
binary_expression: "binary_expression",
unary_expression: "unary_expression",
call_expression: "call_expression",
Expand Down
4 changes: 2 additions & 2 deletions src/expander.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ function preexpand_body_curly(step: {
return in_isolation<goodies>(
step.loc,
(loc, k) => preexpand_forms({ ...step, loc, k: (gs) => k(gs.loc, gs) }),
(loc, { rib, context, counter }) => {
(loc, { rib, context, counter, unit }) => {
if (loc.t.tag === "slice") {
const subforms = stx_list_content(loc.t);
const new_loc = change_splicing(
Expand All @@ -238,7 +238,7 @@ function preexpand_body_curly(step: {
}
return go_right(
loc,
(loc) => preexpand_body_curly({ loc, rib, counter, context, unit: step.unit, k: step.k }),
(loc) => preexpand_body_curly({ loc, rib, counter, context, unit, k: step.k }),
(loc) => syntax_error(loc, "no right"),
);
},
Expand Down
3 changes: 3 additions & 0 deletions tests/arrow-function-4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const foo = (x) => {
using_syntax_rules([t,t,x]).rewrite(t);
}
5 changes: 5 additions & 0 deletions tests/arrow-function-4.ts.expanded
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const foo_3 = (x_5) => {
x_5;
};
================================
DONE

0 comments on commit 676cb2d

Please sign in to comment.