diff options
author | ndytts <ndytts@gmail.com> | 2023-11-11 20:28:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-12 02:28:51 +0100 |
commit | 698a3ec3ab3bc6d0707e3a84acffb7af1e31fd57 (patch) | |
tree | 3419999b93f2326bad7396b4c28c6cea8067217b | |
parent | 3cd8021ef48e4df2716b9388d179da24c523a76c (diff) | |
download | lite-xl-plugins-698a3ec3ab3bc6d0707e3a84acffb7af1e31fd57.tar.gz lite-xl-plugins-698a3ec3ab3bc6d0707e3a84acffb7af1e31fd57.zip |
fix comments and strings in language_cmake.lua (#339)
* fix comments and strings in language_cmake.lua
* Update manifest.json
* Remove unneeded pattern in language_cmake.lua
-rw-r--r-- | manifest.json | 2 | ||||
-rw-r--r-- | plugins/language_cmake.lua | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/manifest.json b/manifest.json index c484aca..6eae056 100644 --- a/manifest.json +++ b/manifest.json @@ -619,7 +619,7 @@ }, { "description": "Syntax for the CMake build system language", - "version": "0.1", + "version": "0.2", "path": "plugins/language_cmake.lua", "id": "language_cmake", "mod_version": "3", diff --git a/plugins/language_cmake.lua b/plugins/language_cmake.lua index 19f1aa5..aa6077c 100644 --- a/plugins/language_cmake.lua +++ b/plugins/language_cmake.lua @@ -4,14 +4,16 @@ local syntax = require "core.syntax" syntax.add { name = "CMake", files = { "%.cmake$", "CMakeLists.txt$" }, - comment = "//", + comment = "#", + block_comment = { "#[[", "]]" }, patterns = { - { pattern = { "#", "[^\\]\n" }, type = "comment" }, - { pattern = { '"', '"', '\\' }, type = "string" }, - { pattern = { "'", "'", '\\' }, type = "string" }, - { pattern = "[%a_][%w_]*%f[(]", type = "function" }, - { pattern = "[%a_][%w_]*", type = "normal" }, - { pattern = "%${[%a_][%w_]*%}", type = "operator" }, + { pattern = { '#%[=*%[', '%]=*%]' }, type = "comment" }, + { pattern = "#.*", type = "comment" }, + { pattern = { '%[=*%[', '%]=*%]' }, type = "string" }, + { pattern = { '"', '"', '\\' }, type = "string" }, + { pattern = "[%a_][%w_]*%f[(]", type = "function" }, + { pattern = "[%a_][%w_]*", type = "normal" }, + { pattern = "%${[%a_][%w_]*%}", type = "operator" }, }, symbols = {}, } |