Skip to content

Commit

Permalink
fix(parser): embrace the latest asai
Browse files Browse the repository at this point in the history
  • Loading branch information
favonia committed Sep 27, 2023
1 parent 070f842 commit 4d2ffb3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/parser/Locate.ml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
open Earley_core

let lexing_position i c =
Asai.Span.of_lex_position @@
Lexing.{
pos_fname = Input.filename i;
pos_lnum = Input.line_num i;
Expand All @@ -10,12 +9,6 @@ let lexing_position i c =
(* This should be BYTE-oriented! *)
}

let locate i1 c1 i2 c2 =
Asai.Span.make (lexing_position i1 c1) (lexing_position i2 c2)

let located p =
p |> Earley.apply_position @@ fun i1 c1 i2 c2 x ->
Asai.Span.{
value = x;
loc = Some (locate i1 c1 i2 c2);
}
Asai.Span.locate_lex (lexing_position i1 c1, lexing_position i2 c2) x

0 comments on commit 4d2ffb3

Please sign in to comment.