From 9234d38219ffa40786a79b6332b430d3da49c18f Mon Sep 17 00:00:00 2001 From: Robin Stocker Date: Mon, 24 Jul 2017 11:31:08 +1000 Subject: [PATCH] Grammar: Use non-ambiguous syntax for xdigit class While `\p{XDigit}` works, alternate regex engines might interpret it according to UTS #18, which contains more than just the ASCII characters, or not even implement it at all. The YAML spec only contains the ASCII characters, see here: http://yaml.org/spec/1.2/spec.html#id2775468 --- Syntaxes/YAML.tmLanguage | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Syntaxes/YAML.tmLanguage b/Syntaxes/YAML.tmLanguage index c0d7139..9dfd07f 100644 --- a/Syntaxes/YAML.tmLanguage +++ b/Syntaxes/YAML.tmLanguage @@ -370,8 +370,8 @@ (?:[ \t]+ ((?:!(?:[0-9A-Za-z\-]*!)?)) (?:[ \t]+ ( - ! (?x: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )* - | (?![,!\[\]{}]) (?x: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ + ! (?x: %[0-9A-Fa-f]{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )* + | (?![,!\[\]{}]) (?x: %[0-9A-Fa-f]{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ ) )? )? @@ -1124,8 +1124,8 @@ (?x) \G (?: - ! < (?: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ > - | (?:!(?:[0-9A-Za-z\-]*!)?) (?: %\p{XDigit}{2} | [0-9A-Za-z\-#;/?:@&=+$_.~*'()] )+ + ! < (?: %[0-9A-Fa-f]{2} | [0-9A-Za-z\-#;/?:@&=+$,_.!~*'()\[\]] )+ > + | (?:!(?:[0-9A-Za-z\-]*!)?) (?: %[0-9A-Fa-f]{2} | [0-9A-Za-z\-#;/?:@&=+$_.~*'()] )+ | ! ) (?=\ |\t|$)