Skip to content

Commit ca56841

Browse files
committed
Merge branch 'use-function'
2 parents 502c96d + aca1925 commit ca56841

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

syntax/php.vim

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ syn keyword phpStatement __construct __destruct __call __callStatic __get __set
519519
syn keyword phpKeyword die exit eval empty isset unset list instanceof insteadof contained
520520

521521
" Include & friends
522-
syn keyword phpInclude include include_once require require_once namespace use contained
522+
syn keyword phpInclude include include_once require require_once namespace contained
523523

524524
" Types
525525
syn keyword phpType bool[ean] int[eger] real double float string array object null self parent global this stdClass callable contained
@@ -679,6 +679,16 @@ syntax match phpClassImplements contained
679679
syntax match phpClassDelimiter contained
680680
\ nextgroup=phpClassImplements skipwhite skipempty /,/
681681

682+
" use statement
683+
syn keyword phpInclude use contained
684+
\ nextgroup=phpUseFunction,phpUseClass skipwhite skipempty
685+
syn match phpUseFunction /function\_s\+\(\\\|\h\w*\)*\h\w*/ contained contains=phpUseKeyword
686+
\ nextgroup=phpUseAlias skipwhite skipempty
687+
syn match phpUseClass /\(function\_s\+\)\@!\(\\\|\h\w*\)*\h\w*/ contained
688+
\ nextgroup=phpUseAlias skipwhite skipempty
689+
syn match phpUseAlias /as\_s\+\h\w*/ contained contains=phpUseKeyword
690+
syn match phpUseKeyword /\(function\|as\)\_s\+/ contained contains=phpKeyword
691+
682692
" Function name
683693
syn keyword phpKeyword function contained
684694
\ nextgroup=phpFunction skipwhite skipempty

0 commit comments

Comments
 (0)