diff 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
line wrap: on
line diff
--- a/runtime/syntax/php.vim
+++ b/runtime/syntax/php.vim
@@ -1,9 +1,11 @@
 " Vim syntax file
 " Language: php PHP 3/4/5/7
-" Maintainer: Jason Woofenden <jason@jasonwoof.com>
-" Last Change: Oct 19, 2019
-" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD
-" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
+" Maintainer: Tyson Andre <tysonandre775@hotmail.com>
+" Last Change: May 11, 2020
+" URL: https://github.com/TysonAndre/vim-syntax
+" Former Maintainers: 
+"         Jason Woofenden <jason@jasonwoof.com>
+"         Peter Hodge <toomuchphp-vim@yahoo.com>
 "         Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
 "
 " Note: If you are using a colour terminal with dark background, you will
@@ -91,7 +93,7 @@ if exists( "php_htmlInStrings")
   syn cluster phpAddStrings add=@htmlTop
 endif
 
-" make sure we can use \ at the begining of the line to do a continuation
+" make sure we can use \ at the beginning of the line to do a continuation
 let s:cpo_save = &cpo
 set cpo&vim
 
@@ -314,7 +316,7 @@ syn region phpIdentifierComplexP matchgr
   " define a cluster to get all interpolation syntaxes for double-quoted strings
   syn cluster phpInterpDouble contains=phpInterpSimple,phpInterpSimpleCurly,phpInterpDollarCurly1,phpInterpDollarCurly2,phpInterpBogusDollarCurley,phpInterpComplex
 
-" Methoden
+" Methods
 syn match phpMethodsVar "->\h\w*" contained contains=phpMethods,phpMemberSelector display
 
 " Include
@@ -328,14 +330,14 @@ syn keyword phpBoolean true false contai
 
 " Float
 " Refer to: https://www.php.net/manual/en/language.types.float.php
-syn match phpFloat "\%(\w\|\.\)\@<!\%(\d\|\.\)*\d\%(\d\|\.\)*\%([eE][+-]\=\%(\d\|\.\)\+\)\=\%(\w\|\.\)\@!" contained contains=phpFloatError display
-syn match phpFloatError "[eE.].*\." contained display
+syn match phpFloat "\%(\w\|\.\)\@<!\%(\d_\?\|\.\)*\d\%(\d\|_\|\.\)*\%([eE][+-]\=\%(\d\|_\|\.\)\+\)\=\%(\w\|\.\)\@!" contained contains=phpFloatError display
+syn match phpFloatError "\%([eE.][0-9._+-]*\.\|__\|_\(\>\|[eE]\)\|\(\>\|[eE]\)_\)" contained display
 
 " Number
-syn match phpNumber "\%(\.\)\@<!\<\%([1-9]\d*\|0\|0[xX]\x\+\)\>\%(\.\)\@!" contained display
+syn match phpNumber "\%(\.\)\@<!\<\%([1-9]\d*\|0\|0[xX]\(\x_\?\)*\x\)\>\%(\.\)\@!" contained display
 syn match phpNumber "\%(\.\)\@<!\<0\d\+\>\%(\.\)\@!" contained contains=phpOctalError display
 syn match phpBinaryError "[2-9]" contained display
-syn match phpNumber "\%(\.\)\@<!\<0[bB]\d\+\>\%(\.\)\@!" contained contains=phpBinaryError display
+syn match phpNumber "\%(\.\)\@<!\<0[bB]\(\d_\?\)*\d\>\%(\.\)\@!" contained contains=phpBinaryError display
 
 " Backslash escapes
 syn case match
@@ -442,6 +444,7 @@ if exists("php_folding") && php_folding=
 " match one line constructs here and skip them at folding
   syn keyword phpSCKeyword abstract final private protected public static contained
   syn keyword phpFCKeyword function contained
+  syn keyword phpDefine fn contained
   syn keyword phpStorageClass global contained
   syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword
   syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\(\s\+.*}\)\@=" contained
@@ -459,7 +462,7 @@ if exists("php_folding") && php_folding=
   syn region phpFoldCatch matchgroup=Exception start="^\z(\s*\)catch\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
   syn region phpFoldTry matchgroup=Exception start="^\z(\s*\)try\s\+\([^}]*$\)\@=" matchgroup=Delimiter end="^\z1}" contains=@phpClFunction,phpFoldFunction contained transparent fold extend
 else
-  syn keyword phpDefine function contained
+  syn keyword phpDefine function fn contained
   syn keyword phpStructure abstract class trait interface contained
   syn keyword phpException catch throw try finally contained
   syn keyword phpStorageClass final global private protected public static contained