|
1 | 1 | " Vim syntax file |
2 | 2 | " Language: PHP 5.3 & up |
3 | 3 | " Maintainer: Paul Garvin <paul@paulgarvin.net> |
4 | | -" Last Change: October 23, 2009 |
| 4 | +" Last Change: April 2, 2010 |
5 | 5 | " URL: |
6 | 6 | " |
7 | 7 | " Former Maintainer: Peter Hodge <toomuchphp-vim@yahoo.com> |
@@ -478,11 +478,14 @@ syn match phpNumber "\<0x\x\{1,8}\>" contained display |
478 | 478 | syn match phpNumber "\(-\=\<\d+\|-\=\)\.\d\+\>" contained display |
479 | 479 |
|
480 | 480 | " SpecialChar |
481 | | -syn match phpSpecialChar "\\[abcfnrtyv\\]" contained display |
| 481 | +syn match phpSpecialChar "\\[fnrtv\\]" contained display |
482 | 482 | syn match phpSpecialChar "\\\d\{3}" contained contains=phpOctalError display |
483 | 483 | syn match phpSpecialChar "\\x\x\{2}" contained display |
484 | 484 | " corrected highlighting for an escaped '\$' inside a double-quoted string |
485 | 485 | syn match phpSpecialChar "\\\$" contained display |
| 486 | +syn match phpSpecialChar +\\"+ contained display |
| 487 | +syn match phpStrEsc "\\\\" contained display |
| 488 | +syn match phpStrEsc "\\'" contained display |
486 | 489 |
|
487 | 490 | " Error |
488 | 491 | syn match phpOctalError "[89]" contained display |
@@ -511,23 +514,23 @@ endif |
511 | 514 |
|
512 | 515 | " String |
513 | 516 | if exists("php_parent_error_open") |
514 | | - syn region phpStringDouble matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex contained keepend |
515 | | - syn region phpBacktick matchgroup=None start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex contained keepend |
516 | | - syn region phpStringSingle matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings contained keepend |
| 517 | + syn region phpStringDouble matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex,phpStrEsc contained keepend |
| 518 | + syn region phpBacktick matchgroup=None start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex,phpStrEsc contained keepend |
| 519 | + syn region phpStringSingle matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings,phpStrEsc contained keepend |
517 | 520 | else |
518 | | - syn region phpStringDouble matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex contained extend keepend |
519 | | - syn region phpBacktick matchgroup=None start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex contained extend keepend |
520 | | - syn region phpStringSingle matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings contained keepend extend |
| 521 | + syn region phpStringDouble matchgroup=None start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex,phpStrEsc contained extend keepend |
| 522 | + syn region phpBacktick matchgroup=None start=+`+ skip=+\\\\\|\\"+ end=+`+ contains=@phpAddStrings,phpIdentifier,phpSpecialChar,phpIdentifierSimply,phpIdentifierComplex,phpStrEsc contained extend keepend |
| 523 | + syn region phpStringSingle matchgroup=None start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=@phpAddStrings,phpStrEsc contained keepend extend |
521 | 524 | endif |
522 | 525 |
|
523 | 526 | " HereDoc |
524 | 527 | syn case match |
525 | | - syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar keepend extend |
526 | | - syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar keepend extend |
| 528 | + syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\I\i*\)$" end="^\z1\(;\=$\)\@=" contained contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend |
| 529 | + syn region phpHereDoc matchgroup=Delimiter start=+\(<<<\)\@<="\z(\I\i*\)"$+ end="^\z1\(;\=$\)\@=" contained contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend |
527 | 530 | " including HTML,JavaScript,SQL even if not enabled via options |
528 | | - syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar keepend extend |
529 | | - syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar keepend extend |
530 | | - syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar keepend extend |
| 531 | + syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(html\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend |
| 532 | + syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(sql\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend |
| 533 | + syn region phpHereDoc matchgroup=Delimiter start="\(<<<\)\@<=\z(\(\I\i*\)\=\(javascript\)\c\(\i*\)\)$" end="^\z1\(;\=$\)\@=" contained contains=@htmlJavascript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpSpecialChar,phpMethodsVar,phpStrEsc keepend extend |
531 | 534 | syn case ignore |
532 | 535 |
|
533 | 536 | " NowDoc |
@@ -640,6 +643,7 @@ if !exists("did_php_syn_inits") |
640 | 643 | hi def link phpSCKeyword Type |
641 | 644 | hi def link phpMemberSelector Type |
642 | 645 | hi def link phpSpecialChar Special |
| 646 | + hi def link phpStrEsc Special |
643 | 647 | hi def link phpParent Special |
644 | 648 | hi def link phpParentError Error |
645 | 649 | hi def link phpOctalError Error |
|
0 commit comments