Skip to content

Commit

Permalink
have degrout split space cells into single-tok cells
Browse files Browse the repository at this point in the history
  • Loading branch information
dm0n3y committed Jul 24, 2024
1 parent b959f76 commit 1387897
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/parser/Grouter.re
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ let rec degrout = (c: Cell.t): Cells.t =>
|> Chain.loops
|> List.concat_map(degrout)
|> Cells.squash(~save_padding=true)
| Some(m) when Option.is_some(Meld.Space.get(m)) =>
Meld.to_chain(m)
|> Chain.mapi_loop((i, c) => (i, c))
|> Chain.map_linked(((i, l), spc, (_, r)) =>
Cell.put(M(i == 0 ? l : Cell.empty, Wald.of_tok(spc), r))
)
|> Chain.links
| _ => [c]
};

Expand Down Expand Up @@ -141,6 +148,7 @@ let regrout_swings =
|> Options.for_all
);

// todo: rename allocate or something
let regrout = (~repair, ~from, cs, (swings, stances): Walk.t) => {
open Options.Syntax;
let* cs = regrout_swings(~repair, ~from, cs, swings);
Expand Down

0 comments on commit 1387897

Please sign in to comment.