undo recognizing regex delimiters in JS and TS

This commit is contained in:
Rijnard van Tonder 2021-03-01 22:58:36 -07:00
parent 776660f566
commit 3809d9086c
3 changed files with 7 additions and 1 deletions

View File

@ -539,7 +539,7 @@ module Javascript = struct
let escapable_string_literals =
Some
{ delimiters = [{|"|}; {|'|}; {|/|}]
{ delimiters = [{|"|}; {|'|}]
; escape_character = '\\'
}

View File

@ -476,6 +476,8 @@ let%expect_test "dont_detect_comments_in_strings_with_hole_matcher" =
| None -> print_string "BROKEN EXPECT");
[%expect_exact {|// not a comment|}]
(* Deactivated: this will conflict with division syntax *)
(*
let%expect_test "match_regex_delimiters" =
let source = {|/f\/oo/ "/bar/"|} in
let template = {|/:[1]/|} in
@ -486,3 +488,4 @@ let%expect_test "match_regex_delimiters" =
| Some { rewritten_source; _ } -> print_string rewritten_source
| None -> print_string "EXPECT SUCCESS");
[%expect_exact {|f\/oo "/bar/"|}]
*)

View File

@ -476,6 +476,8 @@ let%expect_test "dont_detect_comments_in_strings_with_hole_matcher" =
| None -> print_string "BROKEN EXPECT");
[%expect_exact {|// not a comment|}]
(* Deactivated: this will conflict with division syntax *)
(*
let%expect_test "match_regex_delimiters" =
let source = {|/f\/oo/ "/bar/"|} in
let template = {|/:[1]/|} in
@ -486,3 +488,4 @@ let%expect_test "match_regex_delimiters" =
| Some { rewritten_source; _ } -> print_string rewritten_source
| None -> print_string "EXPECT SUCCESS");
[%expect_exact {|f\/oo "/bar/"|}]
*)