From a2a5db3c901a3c2f28eaab029fd5ce83e943522e Mon Sep 17 00:00:00 2001 From: Ryan Goulden Date: Thu, 16 Feb 2017 14:06:58 -0800 Subject: [PATCH 1/3] Fix '"' in comments Previously, the strings '"' and '\"' (literal, incl. the single quotes and backslash) were misdetected as starting a string inside comment blocks. --- Syntaxes/OCaml.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Syntaxes/OCaml.plist b/Syntaxes/OCaml.plist index c28d2ed..d34adba 100644 --- a/Syntaxes/OCaml.plist +++ b/Syntaxes/OCaml.plist @@ -1275,7 +1275,7 @@ begin - (?=[^\\])(") + (")(?:(?<!\x27")(?<!\x27\x5c")|(?!\x27)) end " name From 0fd5ebee196f22ddeac286a68bf806041257dca1 Mon Sep 17 00:00:00 2001 From: Ryan Goulden Date: Fri, 17 Feb 2017 01:54:24 -0800 Subject: [PATCH 2/3] fix fun()->... There doesn't need to be a space after fun. --- Syntaxes/OCaml.plist | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Syntaxes/OCaml.plist b/Syntaxes/OCaml.plist index d34adba..9371ba9 100644 --- a/Syntaxes/OCaml.plist +++ b/Syntaxes/OCaml.plist @@ -152,7 +152,7 @@ begin - (\(|\s)(?=fun\s) + (\(|\s)(?=fun\b) beginCaptures 1 @@ -177,7 +177,7 @@ begin - (?<=(\(|\s))(fun)\s + (?<=(\(|\s))(fun)\b beginCaptures 2 From 74ccddeabbba983bf2e26fc2a3ba191b3b360023 Mon Sep 17 00:00:00 2001 From: Ryan Goulden Date: Wed, 18 Oct 2017 02:23:40 -0700 Subject: [PATCH 3/3] Module signatures syntax fixes Properly highlight val ( op ) : ... Fix meta.module.signature.val.ocaml end regex --- Syntaxes/OCaml.plist | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Syntaxes/OCaml.plist b/Syntaxes/OCaml.plist index 9371ba9..827e766 100644 --- a/Syntaxes/OCaml.plist +++ b/Syntaxes/OCaml.plist @@ -1498,7 +1498,7 @@ begin - (val)\s+([a-z_][a-zA-Z0-9_']*)\s*(:) + (val)\s+([a-z_][a-zA-Z0-9_']*|\(\s*([#!$%&*+./:<=>?@^|~-]+|and|land|lor|lsl|lsr|asr|lxor|mod|or)\s*\))\s*(:) beginCaptures 1 @@ -1512,13 +1512,18 @@ entity.name.type.value-signature.ocaml 3 + + name + keyword.operator.ocaml + + 4 name punctuation.separator.type-constraint.ocaml end - (?=\b(type|val|external|class|module|end)\b)|^\s*$ + (?=\s*\b(type|val|external|class|module|end)\b)|^\s*$ name meta.module.signature.val.ocaml patterns