Skip to content

Commit

Permalink
Fixed issue in rframe with new filter alt
Browse files Browse the repository at this point in the history
  • Loading branch information
green726 committed Sep 9, 2024
1 parent 609461e commit ac67f6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/grammar/regex/RFrame.re
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ let opt_ = Alt_([Regex.eps], []);
let aseq_ = (ls, rs) =>
seq_(List.map(Regex.atom, ls), List.map(Regex.atom, rs));

let retuple_alt = (rs: list('a)): list((string, 'a)) =>
List.map(r => ("", r), rs);

let zip = (f: t(_), r: Regex.t(_)) =>
switch (f) {
| Star_ => Regex.Star(r)
| Alt_(ls, rs) => Alt(List.rev(ls) @ [r, ...rs])
| Alt_(ls, rs) => Alt(retuple_alt(List.rev(ls) @ [r, ...rs]))
| Seq_(ls, rs) => Seq(List.rev(ls) @ [r, ...rs])
};

Expand Down

0 comments on commit ac67f6f

Please sign in to comment.