aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohan Vashisht <81112205+RohanVashisht1234@users.noreply.github.com>2024-10-11 01:05:29 +0530
committerGitHub <noreply@github.com>2024-10-10 15:35:29 -0400
commit492cafc3724040455b4d63bdb4525172a1e3dd1a (patch)
treefce30c4c9e38365ce7f1101e21f7d3764e43bef6
parent244b5fe5036663afd62a9fa2b319f51832fd040e (diff)
downloadlite-xl-plugins-492cafc3724040455b4d63bdb4525172a1e3dd1a.tar.gz
lite-xl-plugins-492cafc3724040455b4d63bdb4525172a1e3dd1a.zip
Update language_clojure.lua (#490)
* Update language_clojure.lua * Update language_clojure.lua * Update manifest.json
-rw-r--r--manifest.json2
-rw-r--r--plugins/language_clojure.lua37
2 files changed, 19 insertions, 20 deletions
diff --git a/manifest.json b/manifest.json
index 8d3ec9a..327b9a1 100644
--- a/manifest.json
+++ b/manifest.json
@@ -800,7 +800,7 @@
"tags": [
"language"
],
- "version": "0.2"
+ "version": "0.3"
},
{
"description": "Syntax for the CMake build system language",
diff --git a/plugins/language_clojure.lua b/plugins/language_clojure.lua
index 6e50352..1344718 100644
--- a/plugins/language_clojure.lua
+++ b/plugins/language_clojure.lua
@@ -3,8 +3,8 @@
-- mod-version:3
local syntax = require "core.syntax"
syntax.add {
- name = "Clojure", -- tested ok
- comment = ";;", -- tested ok
+ name = "Clojure",
+ comment = ";;",
files = {
"%.clj$",
"%.cljs$",
@@ -12,23 +12,22 @@ syntax.add {
"%.edn$",
},
patterns = {
- { pattern = ';;.*', type = 'comment' }, -- tested ok
- { pattern = ';.*', type = 'comment' }, -- tested ok
- { pattern = { '#"', '"', '\\' }, type = 'string' }, -- tested ok
- { pattern = { '"', '"', '\\' }, type = 'string' }, -- tested ok
- { pattern = { '"""', '"""', '\\' }, type = 'string' }, -- tested ok
- { pattern = 'Retention()%s+()[%a_][%w_/]*', type = { 'keyword', 'normal', 'literal' } }, -- tested ok
- { pattern = ':[%a_][%w_/%-]*', type = 'keyword2' }, -- tested ok
- { pattern = '[%a_][%w_]*()%.()[%a_][%w_/%-]*', type = { 'keyword', 'operator', 'keyword2' } },
- { pattern = "%(()def()%s+()[%a_][%w_%-]*", type = { "normal", "keyword", "literal", 'literal' } }, -- tested ok
- { pattern = "%(()def[%a_][%w_]*()%s+()[%a_][%w_%-]*", type = { "normal", "keyword", "literal", 'literal' } }, -- tested ok
- { pattern = '%(()require()%s+()[%a_][%w_]*', type = { 'normal', 'keyword', 'literal', 'literal' } }, -- tested ok
- { pattern = '%(()[%a_][%w_/]*', type = { 'normal', 'literal' } }, -- tested ok
- { pattern = '-?0x%x+', type = 'number' }, -- tested ok
- { pattern = '-?%d+[%d%.eE]*f?', type = 'number' }, -- tested ok
- { pattern = '-?%.?%d+f?', type = 'number' }, -- tested ok
- { pattern = '[!%#%$%%&*+./%<=>%?@\\%^|%-~:]', type = 'operator' }, -- tested ok
- { pattern = "[%a_'][%w_']*", type = 'normal' }, -- tested ok
+ { pattern = ';;.*', type = 'comment' }, -- Single-line Comment
+ { pattern = ';.*', type = 'comment' }, -- Single-line Comment
+ { pattern = { '#"', '"', '\\' }, type = 'string' }, -- Multiline String
+ { pattern = { '"', '"', '\\' }, type = 'string' }, -- Multiline String
+ { pattern = { '"""', '"""', '\\' }, type = 'string' }, -- Multiline String
+ { pattern = ':[%a_][%w_/%-]*', type = 'keyword2' }, -- word after ':' a.k.a (Var metadata)
+ { pattern = '[%a_][%w_]*()%.()[%a_][%w_/%-]*', type = { 'keyword', 'operator', 'keyword2' } }, -- Things like something.something
+ { pattern = "%(()def()%s+()[%a_][%w_%-]*", type = { "normal", "keyword", "literal", 'literal' } }, -- function definition
+ { pattern = "%(()def[%a_][%w_]*()%s+()[%a_][%w_%-]*", type = { "normal", "keyword", "literal", 'literal' } }, -- function definition but with something along with def like: defn, defmacro etc.
+ { pattern = '%(()require()%s+()[%a_][%w_]*', type = { 'normal', 'keyword', 'literal', 'literal' } }, -- highlight the word after require keyword
+ { pattern = '%(()[%a_][%w_/]*', type = { 'normal', 'literal' } }, -- patterns that are like this: (my_function/subdir_1)
+ { pattern = '-?0x%x+', type = 'number' }, -- Hexadecimal
+ { pattern = '-?%d+[%d%.eE]*f?', type = 'number' }, -- Floating-point numbers
+ { pattern = '-?%.?%d+f?', type = 'number' }, -- Floating-point numbers
+ { pattern = '[!%#%$%%&*+./%<=>%?@\\%^|%-~:]', type = 'operator' }, -- Character classes
+ { pattern = "[%a_'][%w_']*", type = 'normal' }, -- Normal
},
symbols = {
['def'] = 'keyword', -- tested ok