Skip to content

Commit

Permalink
chore: add lexer.mli
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

ps-id: 65439b6f-a4a5-4f38-bab3-58d2e59e65e2
  • Loading branch information
rgrinberg committed Aug 31, 2022
1 parent a99543b commit 38c753f
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions otherlibs/ocamlc_loc/src/lexer.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
exception Unknown_format

type lines =
| Single of int
| Range of int * int

type source =
| Code of
{ code : int
; name : string
}
| Alert of string

type severity =
| Error of source option
| Warning of source

type loc =
{ chars : (int * int) option
; lines : lines
; path : string
}

type line =
{ indent : int
; contents : string
}

type token =
| Toplevel of
{ indent : int
; loc : loc
; severity : severity
; message : string
}
| Related of
{ indent : int
; loc : loc
; message : string
}
| Line of line
| Eof

val token : Lexing.lexbuf -> token

0 comments on commit 38c753f

Please sign in to comment.