From 179d23ee3872b792e1db6af4a13612622909be35 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sun, 1 Jul 2018 15:20:12 +0700 Subject: [PATCH] Expose the type of tokens and lexers This will be necessary for some manual parsing Signed-off-by: Rudi Grinberg --- src/usexp/usexp.mli | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/usexp/usexp.mli b/src/usexp/usexp.mli index f6c55388..bc0ad768 100644 --- a/src/usexp/usexp.mli +++ b/src/usexp/usexp.mli @@ -28,6 +28,8 @@ module Loc : sig val in_file : string -> t val none : t + + val of_lexbuf : Lexing.lexbuf -> t end module Template : sig @@ -112,7 +114,18 @@ end exception Parse_error of Parse_error.t module Lexer : sig - type t + module Token : sig + type t = + | Atom of Atom.t + | Quoted_string of string + | Lparen + | Rparen + | Sexp_comment + | Eof + | Template of Template.t + end + + type t = Lexing.lexbuf -> Token.t val token : t val jbuild_token : t