Improve php string highlighting

Fixes #1753
This commit is contained in:
Zachary Yedidia
2020-07-01 23:38:47 -04:00
parent 2c4035aa65
commit 977290d77b
2 changed files with 8 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@@ -12,7 +12,6 @@ rules:
- special: "&[^;[[:space:]]]*;" - special: "&[^;[[:space:]]]*;"
- symbol: "[:=]" - symbol: "[:=]"
- identifier: "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)=" - identifier: "(alt|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)="
- constant.string: "\"[^\"]*\""
- constant.number: "(?i)#[0-9A-F]{6,6}" - constant.number: "(?i)#[0-9A-F]{6,6}"
- constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+" - constant.string.url: "(ftp(s)?|http(s)?|git|chrome)://[^ ]+"
- comment: "<!--.+?-->" - comment: "<!--.+?-->"
@@ -33,8 +32,12 @@ rules:
- symbol.operator: "(=>|===|!==|==|!=|&&|\\|\\||::|=|->|\\!)" - symbol.operator: "(=>|===|!==|==|!=|&&|\\|\\||::|=|->|\\!)"
- identifier.var: "(\\$[a-zA-Z0-9\\-_]+)" - identifier.var: "(\\$[a-zA-Z0-9\\-_]+)"
- symbol.operator: "[\\(|\\)|/|+|\\-|\\*|\\[|.|,|;]" - symbol.operator: "[\\(|\\)|/|+|\\-|\\*|\\[|.|,|;]"
- constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" - constant.string:
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]" start: "\""
end: "\""
skip: "\\\\."
rules:
- constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]"
- symbol.brackets: "(\\[|\\]|\\{|\\}|[()])" - symbol.brackets: "(\\[|\\]|\\{|\\}|[()])"
- comment: "(^|[[:space:]])//.*" - comment: "(^|[[:space:]])//.*"
- comment: "(^|[[:space:]])#.*" - comment: "(^|[[:space:]])#.*"