From fb6f27e86f2ca2fbff88737251d9e26016a62081 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 22 Sep 2021 15:12:06 +0200 Subject: vim-patch:34cc7d8c034f #15753 Update runtime files https://github.com/vim/vim/commit/34cc7d8c034f2bc5b57455577051db8d72e2b87c --- runtime/syntax/php.vim | 267 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 251 insertions(+), 16 deletions(-) (limited to 'runtime/syntax/php.vim') diff --git a/runtime/syntax/php.vim b/runtime/syntax/php.vim index 7b0085cd6e..80662d6750 100644 --- a/runtime/syntax/php.vim +++ b/runtime/syntax/php.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: php PHP 3/4/5/7/8 " Maintainer: Tyson Andre -" Last Change: Dec 22, 2020 +" Last Change: Sep 18, 2021 " URL: https://github.com/TysonAndre/php-vim-syntax " Former Maintainers: " Jason Woofenden @@ -13,10 +13,32 @@ " than the default colourscheme, because elflord's colours will better " highlight the break-points (Statements) in your code. " +" Note: This embeds a modified copy of the html.vim with (mostly) different symbols, +" in order to implement php_htmlInStrings=2 can work as expected and correctly parse +" ` +" Previous Maintainer Claudio Fleiner +" Repository https://notabug.org/jorgesumle/vim-html-syntax +" Last Change 2021 Mar 02 +" Included patch #7900 to fix comments +" Included patch #7916 to fix a few more things +" " Options: " Set to anything to enable: " php_sql_query SQL syntax highlighting inside strings " php_htmlInStrings HTML syntax highlighting inside strings +" +" By setting this to 2, this will use a local copy of +" HTML syntax highlighting instead of the official +" HTML syntax highlighting, and properly highlight +" `&]" + + " tags + syn region phpInnerHtmlString contained start=+"+ end=+"+ contains=phpInnerHtmlSpecialChar,javaScriptExpression,@phpInnerHtmlPreproc + syn region phpInnerHtmlString contained start=+'+ end=+'+ contains=phpInnerHtmlSpecialChar,javaScriptExpression,@phpInnerHtmlPreproc + syn match phpInnerHtmlValue contained "=[\t ]*[^'" \t>][^ \t>]*"hs=s+1 contains=javaScriptExpression,@phpInnerHtmlPreproc + syn region phpInnerHtmlEndTag contained start=++ contains=phpInnerHtmlTagN,phpInnerHtmlTagError + syn region phpInnerHtmlTag contained start=+<[^/]+ end=+>+ fold contains=phpInnerHtmlTagN,phpInnerHtmlString,htmlArg,phpInnerHtmlValue,phpInnerHtmlTagError,phpInnerHtmlEvent,phpInnerHtmlCssDefinition,@phpInnerHtmlPreproc,@phpInnerHtmlArgCluster + syn match phpInnerHtmlTagN contained +<\s*[-a-zA-Z0-9]\++hs=s+1 contains=htmlTagName,htmlSpecialTagName,@phpInnerHtmlTagNameCluster + syn match phpInnerHtmlTagN contained +]<"ms=s+1 + + + " special characters + syn match phpInnerHtmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};" + + " Comments (the real ones or the old netscape ones) + if exists("html_wrong_comments") + syn region phpInnerHtmlComment start=+ + " Idem 8.2.4.43,44: Except and are parser errors + " Idem 8.2.4.52: dash-dash-bang (--!>) is error ignored by parser, also closes comment + syn region phpInnerHtmlComment matchgroup=phpInnerHtmlComment start=+ is all right + syn match phpInnerHtmlCommentNested contained "\@!" + syn match phpInnerHtmlCommentError contained "[^>+ keepend + + " server-parsed commands + syn region phpInnerHtmlPreProc start=++ contains=phpInnerHtmlPreStmt,phpInnerHtmlPreError,phpInnerHtmlPreAttr + syn match phpInnerHtmlPreStmt contained "