" Vim syntax file
" Language: php PHP 3/4/5
" Maintainer: Jason Woofenden <jason@jasonwoof.com>
-" Last Change: July 29, 2011
+" Last Change: Oct 20, 2011
" URL: https://gitorious.org/jasonwoof/vim-syntax/blobs/master/php.vim
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
syn cluster phpAddStrings add=@htmlTop
endif
+" make sure we can use \ at the begining of the line to do a continuation
+let s:cpo_save = &cpo
+set cpo&vim
+
syn case match
" Env Variables
" Interpolated indentifiers (inside strings)
syn match phpBrackets "[][}{]" contained display
" errors
- syn match phpInterpSimpleError "\[[^]]*\]" contained display
+ syn match phpInterpSimpleError "\[[^]]*\]" contained display " fallback (if nothing else matches)
syn match phpInterpSimpleError "->[^a-zA-Z_]" contained display
" make sure these stay above the correct DollarCurlies so they don't take priority
- syn match phpInterpBogusDollarCurley "${.*}" contained display
+ syn match phpInterpBogusDollarCurley "${[^}]*}" contained display " fallback (if nothing else matches)
syn match phpinterpSimpleBracketsInner "\w\+" contained
syn match phpInterpSimpleBrackets "\[\h\w*]" contained contains=phpBrackets,phpInterpSimpleBracketsInner
syn match phpInterpSimpleBrackets "\[\d\+]" contained contains=phpBrackets,phpInterpSimpleBracketsInner
unlet main_syntax
endif
+" put cpoptions back the way we found it
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
" vim: ts=8 sts=2 sw=2 expandtab