From ad58f842ce12fab67d1bdaa2b9f9140d0963322d Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Tue, 24 Oct 2017 11:02:07 +0200 Subject: [PATCH] [php] update grammar --- extensions/php/syntaxes/php.tmLanguage.json | 47 ++----------------- .../colorize-results/issue-28354_php.json | 2 +- 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/extensions/php/syntaxes/php.tmLanguage.json b/extensions/php/syntaxes/php.tmLanguage.json index 5a49ff84c7c..aa0446b8af1 100644 --- a/extensions/php/syntaxes/php.tmLanguage.json +++ b/extensions/php/syntaxes/php.tmLanguage.json @@ -4,7 +4,7 @@ "If you want to provide a fix or improvement, please create a pull request against the original repository.", "Once accepted there, we are happy to receive an update request." ], - "version": "https://github.com/atom/language-php/commit/8f56c3d5a59fb26e028a8b02c697920c73214fca", + "version": "https://github.com/atom/language-php/commit/71231bfb975ac56d9c13c5b4cda21c081ebbc6ee", "scopeName": "text.html.php", "name": "PHP", "fileTypes": [ @@ -20,7 +20,8 @@ "php5", "phpt", "phtml", - "profile" + "profile", + "theme" ], "firstLineMatch": "(?x)\n# Hashbang\n^\\#!.*(?:\\s|\\/)\n php\\d?\n(?:$|\\s)\n|\n# Modeline\n(?i:\n # Emacs\n -\\*-(?:\\s*(?=[^:;\\s]+\\s*-\\*-)|(?:.*?[;\\s]|(?<=-\\*-))mode\\s*:\\s*)\n php\n (?=[\\s;]|(?]?\\d+|m)?|\\sex)(?=:(?=\\s*set?\\s[^\\n:]+:)|:(?!\\s*set?\\s))(?:(?:\\s|\\s*:\\s*)\\w*(?:\\s*=(?:[^\\n\\\\\\s]|\\\\.)*)?)*[\\s:](?:filetype|ft|syntax)\\s*=\n (?:php|phtml)\n (?=\\s|:|$)\n)", "foldingStartMarker": "(/\\*|\\{\\s*$|<<))", - "beginCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.leading.php" - } - }, - "end": "(?!\\G)(\\s*$\\n)?", - "endCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.trailing.php" - } - }, - "patterns": [ - { - "begin": "<\\?(?i:php|=)?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - } - }, - "contentName": "source.php", - "end": "(\\?)>", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "source.php" - } - }, - "name": "meta.embedded.block.php", - "patterns": [ - { - "include": "#language" - } - ] - } - ] - }, { "begin": "<\\?(?i:php|=)?(?![^?]*\\?>)", "beginCaptures": { @@ -2556,7 +2517,7 @@ "scope-resolution": { "patterns": [ { - "match": "(?i)\\b([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)(?=\\s*::)", + "match": "(?i)([a-z_\\x{7f}-\\x{ff}\\\\][a-z0-9_\\x{7f}-\\x{ff}\\\\]*)(?=\\s*::)", "captures": { "1": { "patterns": [ diff --git a/extensions/php/test/colorize-results/issue-28354_php.json b/extensions/php/test/colorize-results/issue-28354_php.json index 553ade314b5..ec02263f54e 100644 --- a/extensions/php/test/colorize-results/issue-28354_php.json +++ b/extensions/php/test/colorize-results/issue-28354_php.json @@ -56,7 +56,7 @@ }, { "c": " ", - "t": "text.html.php meta.embedded.block.html source.js punctuation.whitespace.embedded.leading.php", + "t": "text.html.php meta.embedded.block.html source.js", "r": { "dark_plus": "meta.embedded: #D4D4D4", "light_plus": "meta.embedded: #000000",