diff options
author | Chimrod <> | 2023-10-26 16:50:12 +0200 |
---|---|---|
committer | Chimrod <> | 2023-10-30 09:30:55 +0100 |
commit | dc1ae31617bc4c3cfaefc518971bbb153149ca86 (patch) | |
tree | 66524795e7b78987fdedfb5b49963f49b3cdee1a /lib/qparser/lexbuf.mli | |
parent | 12fb712df5e9d1142ca2a3604d6095de6381cf65 (diff) |
Added a state in the string evaluation
Diffstat (limited to 'lib/qparser/lexbuf.mli')
-rw-r--r-- | lib/qparser/lexbuf.mli | 16 |
1 files changed, 13 insertions, 3 deletions
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 *) |