diff --git a/extensions/php/cgmanifest.json b/extensions/php/cgmanifest.json index 4326e0a5e59..15b73aeaf6c 100644 --- a/extensions/php/cgmanifest.json +++ b/extensions/php/cgmanifest.json @@ -6,11 +6,11 @@ "git": { "name": "language-php", "repositoryUrl": "https://github.com/atom/language-php", - "commitHash": "e2637e1c522c932459eb2d5cf1651c5cc38058a1" + "commitHash": "72739e6341b1b4bf4aa185e928932983baca449e" } }, "license": "MIT", - "version": "0.44.7" + "version": "0.46.0" } ], "version": 1 diff --git a/extensions/php/syntaxes/php.tmLanguage.json b/extensions/php/syntaxes/php.tmLanguage.json index 27a13e74c1b..d6341cce2c1 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/e2637e1c522c932459eb2d5cf1651c5cc38058a1", + "version": "https://github.com/atom/language-php/commit/72739e6341b1b4bf4aa185e928932983baca449e", "scopeName": "source.php", "patterns": [ { @@ -367,6 +367,9 @@ } ] }, + { + "include": "#match_statement" + }, { "include": "#switch_statement" }, @@ -626,7 +629,7 @@ } }, "contentName": "meta.function.parameters.php", - "end": "(?xi)\n(\\)) \\s* ( : \\s*\n (?:\\?\\s*)? (?!\\s) [a-z0-9_\\x{7f}-\\x{7fffffff}\\\\\\s\\|]+ (?)(\\$?{)", + "begin": "(\\??->)\\s*(\\$?{)", "beginCaptures": { "1": { "name": "keyword.operator.class.php" @@ -2323,7 +2326,7 @@ ] }, { - "begin": "(?i)(->)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)\\s*(\\()", + "begin": "(?i)(\\??->)\\s*([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.operator.class.php" @@ -2363,7 +2366,7 @@ "name": "punctuation.definition.variable.php" } }, - "match": "(?i)(->)((\\$+)?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?" + "match": "(?i)(\\??->)\\s*((\\$+)?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?" } ] }, @@ -2462,8 +2465,8 @@ "include": "#instantiation" }, { - "begin": "(?xi)\n(?=[a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]+(::)\n ([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?\n)", - "end": "(?i)(::)([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?", + "begin": "(?xi)\n(?=[a-z0-9_\\x{7f}-\\x{7fffffff}\\\\]+\n (::)\\s*([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?\n)", + "end": "(?i)(::)\\s*([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*)?", "endCaptures": { "1": { "name": "keyword.operator.class.php" @@ -3416,6 +3419,67 @@ } ] }, + "match_statement": { + "patterns": [ + { + "match": "\\s+(?=match\\b)" + }, + { + "begin": "\\bmatch\\b", + "beginCaptures": { + "0": { + "name": "keyword.control.match.php" + } + }, + "end": "}|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.section.match-block.end.bracket.curly.php" + } + }, + "name": "meta.match-statement.php", + "patterns": [ + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.match-expression.begin.bracket.round.php" + } + }, + "end": "\\)|(?=\\?>)", + "endCaptures": { + "0": { + "name": "punctuation.definition.match-expression.end.bracket.round.php" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.definition.section.match-block.begin.bracket.curly.php" + } + }, + "end": "(?=}|\\?>)", + "patterns": [ + { + "match": "=>", + "name": "keyword.definition.arrow.php" + }, + { + "include": "$self" + } + ] + } + ] + } + ] + }, "use-inner": { "patterns": [ { @@ -3525,7 +3589,7 @@ "name": "punctuation.section.array.end.php" } }, - "match": "(?xi)\n((\\$)(?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*))\n(?:\n (->)(\\g)\n |\n (\\[)(?:(\\d+)|((\\$)\\g)|([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*))(\\])\n)?" + "match": "(?xi)\n((\\$)(?[a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*))\\s*\n(?:\n (\\??->)\\s*(\\g)\n |\n (\\[)(?:(\\d+)|((\\$)\\g)|([a-z_\\x{7f}-\\x{7fffffff}][a-z0-9_\\x{7f}-\\x{7fffffff}]*))(\\])\n)?" }, { "captures": {