From 2dd264d5fa36919bf59d514ed4083b757f7a409d Mon Sep 17 00:00:00 2001 From: "service.paradis@gmail.com" Date: Tue, 9 Jun 2015 13:19:46 -0400 Subject: [PATCH 1/3] New PHP patterns to detect PHPDoc comment, PHPDoc variable and Shell command that uses backtick. --- js/language/php.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/js/language/php.js b/js/language/php.js index 943f37d3..9ab14bbf 100644 --- a/js/language/php.js +++ b/js/language/php.js @@ -119,5 +119,28 @@ Rainbow.extend('php', [ } }, 'pattern': /(\(|,\s?)([\w\\]*?)(?=\s\$)/g + }, + +/** + * New PHP patterns for: + * PHPDoc comment + * PHPDoc variable + * Shell command + * + * @author Alexandre Paradis + */ + { + 'name': 'comment.phpdoc', + 'matches': { + 1: { + 'name': 'keyword.phpdoc', + 'pattern': /\s+@\w+/g + } + }, + 'pattern': /\/\*\*([\s\S]*)?\*\//gm + }, + { + 'name': 'shell.command', + 'pattern': /`([\s\S]*)?`/gm } ]); From 3987b8faff85c1dcaff832ec37b4db9f7307abb6 Mon Sep 17 00:00:00 2001 From: "service.paradis@gmail.com" Date: Tue, 9 Jun 2015 16:00:15 -0400 Subject: [PATCH 2/3] New PHP patterns to detect PHPDoc comment, PHPDoc variable and Shell command that uses backtick. --- js/language/php.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/language/php.js b/js/language/php.js index 9ab14bbf..61d8339b 100644 --- a/js/language/php.js +++ b/js/language/php.js @@ -137,7 +137,7 @@ Rainbow.extend('php', [ 'pattern': /\s+@\w+/g } }, - 'pattern': /\/\*\*([\s\S]*)?\*\//gm + 'pattern': /\/\*\*([^\/]([^\/]+)|[^\*]\/)*\*\//gm }, { 'name': 'shell.command', From d44c8b1956fb5d6f21c9061352fb6083c9ca3dca Mon Sep 17 00:00:00 2001 From: "service.paradis@gmail.com" Date: Thu, 11 Jun 2015 08:56:29 -0400 Subject: [PATCH 3/3] Better regex! --- js/language/php.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/language/php.js b/js/language/php.js index 61d8339b..533173e2 100644 --- a/js/language/php.js +++ b/js/language/php.js @@ -134,10 +134,10 @@ Rainbow.extend('php', [ 'matches': { 1: { 'name': 'keyword.phpdoc', - 'pattern': /\s+@\w+/g + 'pattern': /@\w+/g } }, - 'pattern': /\/\*\*([^\/]([^\/]+)|[^\*]\/)*\*\//gm + 'pattern': /\/\*\*([\s\S]*?)\*\//gm }, { 'name': 'shell.command',