From 4f68f7fd92025f9934d1bab74da0c306ad81a85c Mon Sep 17 00:00:00 2001 From: Francesco Abbate Date: Mon, 6 Sep 2021 09:31:17 +0200 Subject: [PATCH] Try to fix problem with js syntax of '/=' operator The operator '/=' was wrongly considered by the js syntax file as the beginning of a regexp literal. With this modification we modify the pattern for regexp literals to not match expressions starting with '/='. This doesn't seem entirely correct because apparently javascript can accept regexp literals starting with '/=' but the rule used by the javascript lexer is not known. --- data/plugins/language_js.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/plugins/language_js.lua b/data/plugins/language_js.lua index 7556b00b..bf899c41 100644 --- a/data/plugins/language_js.lua +++ b/data/plugins/language_js.lua @@ -7,7 +7,7 @@ syntax.add { patterns = { { pattern = "//.-\n", type = "comment" }, { pattern = { "/%*", "%*/" }, type = "comment" }, - { pattern = { '/%g', '/', '\\' }, type = "string" }, + { pattern = { '/[^= ]', '/', '\\' },type = "string" }, { pattern = { '"', '"', '\\' }, type = "string" }, { pattern = { "'", "'", '\\' }, type = "string" }, { pattern = { "`", "`", '\\' }, type = "string" },