diff --git a/extensions/php/syntaxes/php.tmLanguage.json b/extensions/php/syntaxes/php.tmLanguage.json index c5bffdce60a..8d571c01747 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/2091139972d9a5022213697e5ce774cb19053925", + "version": "https://github.com/atom/language-php/commit/f53f2fc2c3f52468b6d205b8c2bbf79aca95f5b2", "scopeName": "text.html.php", "name": "PHP", "fileTypes": [ @@ -153,33 +153,6 @@ "repository": { "class-body": { "patterns": [ - { - "match": "(?xi)\n\\b(use)\\s+\n([a-z_\\x{7f}-\\x{ff}\\\\][a-z0-9_\\x{7f}-\\x{ff}\\\\]*)\n((?:\\s*,\\s*[a-z_\\x{7f}-\\x{ff}\\\\][a-z0-9_\\x{7f}-\\x{ff}\\\\]*)*)\n(?=\\s*;)", - "name": "meta.use.php", - "captures": { - "1": { - "name": "keyword.other.use.php" - }, - "2": { - "patterns": [ - { - "include": "#class-name" - } - ] - }, - "3": { - "patterns": [ - { - "include": "#class-name" - }, - { - "match": ",", - "name": "punctuation.separator.delimiter.php" - } - ] - } - } - }, { "begin": "(?i)\\buse\\b", "beginCaptures": { @@ -187,37 +160,25 @@ "name": "keyword.other.use.php" } }, - "end": "}", - "endCaptures": { - "0": { - "name": "punctuation.definition.use.end.bracket.curly.php" - } - }, + "end": "(?=;)", "name": "meta.use.php", "patterns": [ { - "match": "(?xi)\n([a-z_\\x{7f}-\\x{ff}\\\\][a-z0-9_\\x{7f}-\\x{ff}\\\\]*)\n((?:\\s*,\\s*[a-z_\\x{7f}-\\x{ff}\\\\][a-z0-9_\\x{7f}-\\x{ff}\\\\]*)*)", + "match": "(?i)[a-z_\\x{7f}-\\x{ff}\\\\][a-z0-9_\\x{7f}-\\x{ff}\\\\]*", "captures": { - "1": { + "0": { "patterns": [ { "include": "#class-name" } ] - }, - "2": { - "patterns": [ - { - "include": "#class-name" - }, - { - "match": ",", - "name": "punctuation.separator.delimiter.php" - } - ] } } }, + { + "match": ",", + "name": "punctuation.separator.delimiter.php" + }, { "begin": "{", "beginCaptures": { @@ -225,7 +186,12 @@ "name": "punctuation.definition.use.begin.bracket.curly.php" } }, - "end": "(?=})", + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.use.end.bracket.curly.php" + } + }, "contentName": "meta.use.body.php", "patterns": [ { @@ -1462,14 +1428,6 @@ { "include": "#comments" }, - { - "match": "{", - "name": "punctuation.section.scope.begin.php" - }, - { - "match": "}", - "name": "punctuation.section.scope.end.php" - }, { "begin": "(?i)^\\s*(interface)\\s+([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\\s*(extends)?\\s*", "beginCaptures": { @@ -1606,7 +1564,7 @@ "name": "storage.type.${2:/downcase}.php" } }, - "end": "(?=;|(?:^\\s*$))", + "end": "(?=;)", "name": "meta.use.php", "patterns": [ { @@ -2128,6 +2086,25 @@ { "include": "#string-backtick" }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.curly.php" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.curly.php" + } + }, + "patterns": [ + { + "include": "#language" + } + ] + }, { "begin": "\\[", "beginCaptures": { @@ -3402,7 +3379,7 @@ }, { "match": ",", - "name": "punctuation.definition.separator.delimiter.php" + "name": "punctuation.separator.delimiter.php" } ] }, diff --git a/extensions/php/test/colorize-results/issue-28354_php.json b/extensions/php/test/colorize-results/issue-28354_php.json index a78acbee7a0..94d5419c05b 100644 --- a/extensions/php/test/colorize-results/issue-28354_php.json +++ b/extensions/php/test/colorize-results/issue-28354_php.json @@ -210,7 +210,7 @@ }, { "c": "{", - "t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php punctuation.section.scope.begin.php", + "t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php punctuation.definition.begin.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -430,7 +430,7 @@ }, { "c": "}", - "t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php punctuation.section.scope.end.php", + "t": "text.html.php meta.embedded.block.html source.js meta.embedded.block.php source.php punctuation.definition.end.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", diff --git a/extensions/php/test/colorize-results/test_php.json b/extensions/php/test/colorize-results/test_php.json index dcbe3ab7cfa..d821838bb5f 100644 --- a/extensions/php/test/colorize-results/test_php.json +++ b/extensions/php/test/colorize-results/test_php.json @@ -298,7 +298,7 @@ }, { "c": "{", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.begin.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -353,7 +353,7 @@ }, { "c": "}", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.end.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1310,7 +1310,7 @@ }, { "c": "{", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.begin.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1794,7 +1794,7 @@ }, { "c": "{", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.begin.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1871,7 +1871,7 @@ }, { "c": "}", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.end.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -1915,7 +1915,7 @@ }, { "c": "{", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.begin.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2245,7 +2245,7 @@ }, { "c": "}", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.end.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2267,7 +2267,7 @@ }, { "c": "}", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.end.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -2949,7 +2949,7 @@ }, { "c": "{", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.begin.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3092,7 +3092,7 @@ }, { "c": "{", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.begin.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3202,7 +3202,7 @@ }, { "c": "}", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.end.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3444,7 +3444,7 @@ }, { "c": "}", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.end.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3521,7 +3521,7 @@ }, { "c": "{", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.begin.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.begin.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000", @@ -3532,7 +3532,7 @@ }, { "c": "}", - "t": "text.html.php meta.embedded.block.php source.php punctuation.section.scope.end.php", + "t": "text.html.php meta.embedded.block.php source.php punctuation.definition.end.bracket.curly.php", "r": { "dark_plus": "default: #D4D4D4", "light_plus": "default: #000000",