~tedks/space/trunk

« back to all changes in this revision

Viewing changes to sedlex-experiments/sedlex_menhir.ml

  • Committer: Ted Smith
  • Date: 2023-03-17 18:58:45 UTC
  • Revision ID: tedks@riseup.net-20230317185845-neg7e9v9prb3qdgq
Deleted unnecessary sedlex_menhir code

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
            }
14
14
  in { pos ; stream }
15
15
 
16
 
(** Register a new line in the lexer's position. *)
17
 
let new_line ?(n=0) (lexbuf: lexbuf) =
18
 
  let open Lexing in
19
 
  let lcp = lexbuf.pos in
20
 
  lexbuf.pos <-
21
 
    {lcp with
22
 
      pos_lnum = lcp.pos_lnum + 1;
23
 
      pos_bol = lcp.pos_cnum;
24
 
    }
25
 
 
26
 
(** Update the position with the stream. *)
27
 
let update lexbuf =
28
 
  let new_pos = Sedlexing.lexeme_end lexbuf.stream in
29
 
  let p = lexbuf.pos in
30
 
  lexbuf.pos <- {p with Lexing.pos_cnum = new_pos }
31
16
 
32
17
(** The last matched word. *)
33
18
let lexeme { stream } = Sedlexing.Utf8.lexeme stream