Skip to content

Commit

Permalink
Update language_clojure.lua (#490)
Browse files Browse the repository at this point in the history
* Update language_clojure.lua

* Update language_clojure.lua

* Update manifest.json
  • Loading branch information
RohanVashisht1234 authored Oct 10, 2024
1 parent 244b5fe commit 492cafc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@
"tags": [
"language"
],
"version": "0.2"
"version": "0.3"
},
{
"description": "Syntax for the CMake build system language",
Expand Down
37 changes: 18 additions & 19 deletions plugins/language_clojure.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,31 @@
-- mod-version:3
local syntax = require "core.syntax"
syntax.add {
name = "Clojure", -- tested ok
comment = ";;", -- tested ok
name = "Clojure",
comment = ";;",
files = {
"%.clj$",
"%.cljs$",
"%.clc$",
"%.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
Expand Down

0 comments on commit 492cafc

Please sign in to comment.