Mercurial > vim
comparison runtime/syntax/php.vim @ 20379:7f88f6a3ed4c
Update runtime files
Commit: https://github.com/vim/vim/commit/47e13953ffdbb9f163b901196dec8c2100b72edd
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 12 22:49:12 2020 +0200
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 12 May 2020 23:00:04 +0200 |
parents | e9a47bcf7b94 |
children | d4c7b3e9cd17 |
comparison
equal
deleted
inserted
replaced
20378:e3511d21c324 | 20379:7f88f6a3ed4c |
---|---|
1 " Vim syntax file | 1 " Vim syntax file |
2 " Language: php PHP 3/4/5/7 | 2 " Language: php PHP 3/4/5/7 |
3 " Maintainer: Jason Woofenden <jason@jasonwoof.com> | 3 " Maintainer: Tyson Andre <tysonandre775@hotmail.com> |
4 " Last Change: Oct 19, 2019 | 4 " Last Change: May 11, 2020 |
5 " URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD | 5 " URL: https://github.com/TysonAndre/vim-syntax |
6 " Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com> | 6 " Former Maintainers: |
7 " Jason Woofenden <jason@jasonwoof.com> | |
8 " Peter Hodge <toomuchphp-vim@yahoo.com> | |
7 " Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> | 9 " Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org> |
8 " | 10 " |
9 " Note: If you are using a colour terminal with dark background, you will | 11 " Note: If you are using a colour terminal with dark background, you will |
10 " probably find the 'elflord' colorscheme is much better for PHP's syntax | 12 " probably find the 'elflord' colorscheme is much better for PHP's syntax |
11 " than the default colourscheme, because elflord's colours will better | 13 " than the default colourscheme, because elflord's colours will better |
89 | 91 |
90 if exists( "php_htmlInStrings") | 92 if exists( "php_htmlInStrings") |
91 syn cluster phpAddStrings add=@htmlTop | 93 syn cluster phpAddStrings add=@htmlTop |
92 endif | 94 endif |
93 | 95 |
94 " make sure we can use \ at the begining of the line to do a continuation | 96 " make sure we can use \ at the beginning of the line to do a continuation |
95 let s:cpo_save = &cpo | 97 let s:cpo_save = &cpo |
96 set cpo&vim | 98 set cpo&vim |
97 | 99 |
98 syn case match | 100 syn case match |
99 | 101 |
312 syn region phpInterpComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP contained extend | 314 syn region phpInterpComplex matchgroup=phpParent start="{\$"rs=e-1 end="}" contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP contained extend |
313 syn region phpIdentifierComplexP matchgroup=phpParent start="\[" end="]" contains=@phpClInside contained | 315 syn region phpIdentifierComplexP matchgroup=phpParent start="\[" end="]" contains=@phpClInside contained |
314 " define a cluster to get all interpolation syntaxes for double-quoted strings | 316 " define a cluster to get all interpolation syntaxes for double-quoted strings |
315 syn cluster phpInterpDouble contains=phpInterpSimple,phpInterpSimpleCurly,phpInterpDollarCurly1,phpInterpDollarCurly2,phpInterpBogusDollarCurley,phpInterpComplex | 317 syn cluster phpInterpDouble contains=phpInterpSimple,phpInterpSimpleCurly,phpInterpDollarCurly1,phpInterpDollarCurly2,phpInterpBogusDollarCurley,phpInterpComplex |
316 | 318 |
317 " Methoden | 319 " Methods |
318 syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display | 320 syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display |
319 | 321 |
320 " Include | 322 " Include |
321 syn keyword phpInclude include require include_once require_once use contained | 323 syn keyword phpInclude include require include_once require_once use contained |
322 | 324 |
326 " Boolean | 328 " Boolean |
327 syn keyword phpBoolean true false contained | 329 syn keyword phpBoolean true false contained |
328 | 330 |
329 " Float | 331 " Float |
330 " Refer to: https://www.php.net/manual/en/language.types.float.php | 332 " Refer to: https://www.php.net/manual/en/language.types.float.php |
331 syn match phpFloat "\%(\w\|\.\)\@<!\%(\d\|\.\)*\d\%(\d\|\.\)*\%([eE][+-]\=\%(\d\|\.\)\+\)\=\%(\w\|\.\)\@!" contained contains=phpFloatError display | 333 syn match phpFloat "\%(\w\|\.\)\@<!\%(\d_\?\|\.\)*\d\%(\d\|_\|\.\)*\%([eE][+-]\=\%(\d\|_\|\.\)\+\)\=\%(\w\|\.\)\@!" contained contains=phpFloatError display |
332 syn match phpFloatError "[eE.].*\." contained display | 334 syn match phpFloatError "\%([eE.][0-9._+-]*\.\|__\|_\(\>\|[eE]\)\|\(\>\|[eE]\)_\)" contained display |
333 | 335 |
334 " Number | 336 " Number |
335 syn match phpNumber "\%(\.\)\@<!\<\%([1-9]\d*\|0\|0[xX]\x\+\)\>\%(\.\)\@!" contained display | 337 syn match phpNumber "\%(\.\)\@<!\<\%([1-9]\d*\|0\|0[xX]\(\x_\?\)*\x\)\>\%(\.\)\@!" contained display |
336 syn match phpNumber "\%(\.\)\@<!\<0\d\+\>\%(\.\)\@!" contained contains=phpOctalError display | 338 syn match phpNumber "\%(\.\)\@<!\<0\d\+\>\%(\.\)\@!" contained contains=phpOctalError display |
337 syn match phpBinaryError "[2-9]" contained display | 339 syn match phpBinaryError "[2-9]" contained display |
338 syn match phpNumber "\%(\.\)\@<!\<0[bB]\d\+\>\%(\.\)\@!" contained contains=phpBinaryError display | 340 syn match phpNumber "\%(\.\)\@<!\<0[bB]\(\d_\?\)*\d\>\%(\.\)\@!" contained contains=phpBinaryError display |
339 | 341 |
340 " Backslash escapes | 342 " Backslash escapes |
341 syn case match | 343 syn case match |
342 " for double quotes and heredoc | 344 " for double quotes and heredoc |
343 syn match phpBackslashSequences "\\[fnrtv\\\"$]" contained display | 345 syn match phpBackslashSequences "\\[fnrtv\\\"$]" contained display |
440 " Fold | 442 " Fold |
441 if exists("php_folding") && php_folding==1 | 443 if exists("php_folding") && php_folding==1 |
442 " match one line constructs here and skip them at folding | 444 " match one line constructs here and skip them at folding |
443 syn keyword phpSCKeyword abstract final private protected public static contained | 445 syn keyword phpSCKeyword abstract final private protected public static contained |
444 syn keyword phpFCKeyword function contained | 446 syn keyword phpFCKeyword function contained |
447 syn keyword phpDefine fn contained | |
445 syn keyword phpStorageClass global contained | 448 syn keyword phpStorageClass global contained |
446 syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword | 449 syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword |
447 syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\(\s\+.*}\)\@=" contained | 450 syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\(\s\+.*}\)\@=" contained |
448 syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained | 451 syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained |
449 syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained | 452 syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained |
457 syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend | 460 syn region phpFoldClass matchgroup=Structure start="^\z(\s*\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction,phpSCKeyword contained transparent fold extend |
458 syn region phpFoldInterface matchgroup=Structure start="^\z(\s*\)interface\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend | 461 syn region phpFoldInterface matchgroup=Structure start="^\z(\s*\)interface\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend |
459 syn region phpFoldCatch matchgroup=Exception start="^\z(\s*\)catch\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend | 462 syn region phpFoldCatch matchgroup=Exception start="^\z(\s*\)catch\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend |
460 syn region phpFoldTry matchgroup=Exception start="^\z(\s*\)try\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend | 463 syn region phpFoldTry matchgroup=Exception start="^\z(\s*\)try\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend |
461 else | 464 else |
462 syn keyword phpDefine function contained | 465 syn keyword phpDefine function fn contained |
463 syn keyword phpStructure abstract class trait interface contained | 466 syn keyword phpStructure abstract class trait interface contained |
464 syn keyword phpException catch throw try finally contained | 467 syn keyword phpException catch throw try finally contained |
465 syn keyword phpStorageClass final global private protected public static contained | 468 syn keyword phpStorageClass final global private protected public static contained |
466 if exists("php_folding") && php_folding==2 | 469 if exists("php_folding") && php_folding==2 |
467 setlocal foldmethod=syntax | 470 setlocal foldmethod=syntax |