From 384b3098c8c4a2e26b87167053952b753aa8a63a Mon Sep 17 00:00:00 2001 From: tuohy Date: Tue, 2 Apr 2024 21:57:37 -0400 Subject: [PATCH] Parse escaped escapes before escaped quotes (#449) --- src/lib/uTop_lexer.mll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/uTop_lexer.mll b/src/lib/uTop_lexer.mll index 58dddc4..61b83b0 100644 --- a/src/lib/uTop_lexer.mll +++ b/src/lib/uTop_lexer.mll @@ -173,6 +173,7 @@ and symbol idx acc = parse and cm_string idx= parse | '"' { (String (1, true), idx+1) } + | "\\\\" | "\\\"" { let idx2, terminated= string (idx + 2) false lexbuf in (String (1, terminated), idx2) @@ -222,6 +223,7 @@ and comment idx depth combining= parse and string idx combining= parse | '"' { (idx + 1, true) } + | "\\\\" | "\\\"" { string (idx + 2) false lexbuf } | uchar as uchar