aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/qparser/lex_state.ml12
-rw-r--r--lib/qparser/lexer.ml4
2 files changed, 9 insertions, 7 deletions
diff --git a/lib/qparser/lex_state.ml b/lib/qparser/lex_state.ml
index 4b102b8..2ec1857 100644
--- a/lib/qparser/lex_state.ml
+++ b/lib/qparser/lex_state.ml
@@ -1,6 +1,4 @@
-(** This module provide functions used to parse the strings.
-
- *)
+(** This module provide functions used to parse the strings. *)
exception Out_of_context
@@ -111,8 +109,12 @@ and dQuotedStringWraper : Lexbuf.stringWraper =
let lexbuf = Lexbuf.buffer buffer in
match%sedlex lexbuf with
| single_quote ->
- Buffer.add_char buf '\'';
- wrap ~nested:true f buf buffer
+ if nested then (
+ Buffer.add_char buf '\'';
+ wrap ~nested:false f buf buffer)
+ else (
+ Buffer.add_char buf '\'';
+ wrap ~nested:true f buf buffer)
| double_quote, double_quote ->
Buffer.add_char buf '"';
wrap f buf buffer
diff --git a/lib/qparser/lexer.ml b/lib/qparser/lexer.ml
index 42f3c1c..814c97f 100644
--- a/lib/qparser/lexer.ml
+++ b/lib/qparser/lexer.ml
@@ -147,10 +147,10 @@ let rec read_quoted_string : Lexbuf.stringWraper -> Lexbuf.buffer_builder =
result)
else (
Buffer.add_string buf (Lexbuf.content buffer);
- (f.wrap (read_quoted_string f)) buf buffer)
+ (f.wrap ~nested (read_quoted_string f)) buf buffer)
| eol | any ->
Buffer.add_string buf (Lexbuf.content buffer);
- (f.wrap (read_quoted_string f)) buf buffer
+ (f.wrap ~nested (read_quoted_string f)) buf buffer
| _ -> raise Not_found
(** Track the kind of nested string inside a multiline string inside a