aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatrina Grace <kat@swordglowsblue.com>2022-06-11 16:54:26 -0600
committerGitHub <noreply@github.com>2022-06-11 16:54:26 -0600
commitbe0c036f89724e1d88764425ec0af1fead8e4b8a (patch)
tree6bbc025c67e5f4afa9ba66d1d1528ad9472b5df9
parent7df41835bc47ca905467256e146d76dda2bb172f (diff)
downloadlite-xl-plugins-be0c036f89724e1d88764425ec0af1fead8e4b8a.tar.gz
lite-xl-plugins-be0c036f89724e1d88764425ec0af1fead8e4b8a.zip
Add support for SQL strings to language_php
-rw-r--r--plugins/language_php.lua81
1 files changed, 81 insertions, 0 deletions
diff --git a/plugins/language_php.lua b/plugins/language_php.lua
index 83bd901..d00ea8f 100644
--- a/plugins/language_php.lua
+++ b/plugins/language_php.lua
@@ -24,6 +24,87 @@ syntax.add {
{ pattern = "//.-\n", type = "comment" },
{ pattern = "#.-\n", type = "comment" },
{ pattern = { "/%*", "%*/" }, type = "comment" },
+ -- SQL strings
+ {
+ pattern = { '"[cC][rR][eE][aA][tT][eE]%s+', '"', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '\'[cC][rR][eE][aA][tT][eE]%s+', '\'', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '"[sS][eE][lL][eE][cC][tT]%s+', '"', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '\'[sS][eE][lL][eE][cC][tT]%s+', '\'', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '"[iI][nN][sS][eE][rR][tT]%s+', '"', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '\'[iI][nN][sS][eE][rR][tT]%s+', '\'', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '"[uU][pP][dD][aA][tT][eE]%s+', '"', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '\'[uU][pP][dD][aA][tT][eE]%s+', '\'', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '"[rR][eE][pP][lL][aA][cC][eE]%s+', '"', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '\'[rR][eE][pP][lL][aA][cC][eE]%s+', '\'', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '"[dD][eE][lL][eE][tT][eE]%s+', '"', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '\'[dD][eE][lL][eE][tT][eE]%s+', '\'', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '"[dD][rR][oO][pP]%s+', '"', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '\'[dD][rR][oO][pP]%s+', '\'', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '"[aA][lL][tT][eE][rR]%s+', '"', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
+ {
+ pattern = { '\'[aA][lL][tT][eE][rR]%s+', '\'', '\\' },
+ syntax = '.sql',
+ type = "keyword"
+ },
-- The '\\' is for escaping to work on " or '
{ pattern = { '"', '"', '\\' }, type = "string" },
{ pattern = { "'", "'", '\\' }, type = "string" },