From dc1ae31617bc4c3cfaefc518971bbb153149ca86 Mon Sep 17 00:00:00 2001 From: Chimrod <> Date: Thu, 26 Oct 2023 16:50:12 +0200 Subject: Added a state in the string evaluation --- lib/qparser/lexbuf.mli | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'lib/qparser/lexbuf.mli') diff --git a/lib/qparser/lexbuf.mli b/lib/qparser/lexbuf.mli index 5a0bbcd..db81d2c 100644 --- a/lib/qparser/lexbuf.mli +++ b/lib/qparser/lexbuf.mli @@ -26,6 +26,19 @@ val tokenize : (t -> 'a) -> t -> unit -> 'a * Lexing.position * Lexing.position (** Function to use in the parser in order to extract the token match, and the starting and ending position. *) +val rollback : t -> unit +(** Rollback the latest token matched *) + +type state = Token | String | DString | MString of int | EndString + +val state : t -> state option +(** Get the current state for the lexer *) + +val enter_state : t -> state -> unit +val leave_state : t -> unit + +(** {1 Level in expressions} *) + val level : t -> int (** The state track the nesting level in the expression. Depending of the level, the token [!] will be considered as a comment or a boolean @@ -34,6 +47,3 @@ val level : t -> int val incr_level : t -> unit val decr_level : t -> unit val reset_level : t -> unit - -val rollback : t -> unit -(** Rollback the latest token matched *) -- cgit v1.2.3