Skip to content

Commit 9ae7024

Browse files
committed
Add shading to square brackets
1 parent adcb19c commit 9ae7024

File tree

1 file changed

+24
-14
lines changed

1 file changed

+24
-14
lines changed

grammars/emacs-lisp.cson

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ repository:
3636
{include: "#number"}
3737
{include: "#quote"}
3838
{include: "#symbols"}
39+
{include: "#vectors"}
3940
{include: "#arg-values"}
4041
{include: "#boolean"}
4142
{include: "#stdlib"}
@@ -53,14 +54,14 @@ repository:
5354
# Binding
5455
binding:
5556
name: "storage.binding.emacs.lisp"
56-
match: "\\b(?<=[\\s()]|^)(let\\*?|set[fq]?)(?=[\\s()]|$)"
57+
match: "\\b(?<=[\\s()\\[]|^)(let\\*?|set[fq]?)(?=[\\s()]|$)"
5758

5859

5960
# Boolean constants
6061
boolean:
6162
patterns: [
62-
{name: "constant.boolean.true.emacs.lisp", match: "\\b(?<=[\\s()]|^)t(?=[\\s()]|$)\\b"}
63-
{name: "constant.language.nil.emacs.lisp", match: "\\b(?<=[\\s()]|^)(nil)(?=[\\s()]|$)\\b"}
63+
{name: "constant.boolean.true.emacs.lisp", match: "\\b(?<=[\\s()\\[]|^)t(?=[\\s()]|$)\\b"}
64+
{name: "constant.language.nil.emacs.lisp", match: "\\b(?<=[\\s()\\[]|^)(nil)(?=[\\s()]|$)\\b"}
6465
]
6566

6667

@@ -89,7 +90,7 @@ repository:
8990
patterns: [include: "#defun-innards"]
9091
},{
9192
name: "storage.type.function.emacs.lisp"
92-
match: "\\b(?<=[\\s()]|^)defun(?=[\\s()]|$)"
93+
match: "\\b(?<=[\\s()\\[]|^)defun(?=[\\s()]|$)"
9394
},{
9495
# Generic definition
9596
name: "meta.$3.definition.emacs.lisp"
@@ -107,7 +108,7 @@ repository:
107108
patterns: [include: "$self"]
108109
},{
109110
name: "storage.type.$1.emacs.lisp"
110-
match: "\\b(?<=[\\s()]|^)(define-(?:condition|widget))(?=[\\s()]|$)\\b"
111+
match: "\\b(?<=[\\s()\\[]|^)(define-(?:condition|widget))(?=[\\s()]|$)\\b"
111112
}]
112113

113114

@@ -223,7 +224,7 @@ repository:
223224
# Primitives/Fundamental Lisp functions
224225
functions:
225226
name: "keyword.control.function.$1.emacs.lisp"
226-
match: """(?x)\\b(?<=[\\s()]|^)
227+
match: """(?x)\\b(?<=[\\s()\\[]|^)
227228
(abs|append|apply|assoc|butlast|c[ad]{1,2}r|c[ad]r-safe|consp?|copy-alist|copy-tree
228229
|dolist|funcall|last|length|listp?|load|make-list|mapc|mapcar|max|min|member|nbutlast
229230
|nconc|nreverse|nth|nthcdr|null|pop|prin[1ct]|push|quote|rassoc|reverse|rplac[ad]
@@ -234,7 +235,7 @@ repository:
234235
# :keywords
235236
keyword:
236237
name: "constant.keyword.emacs.lisp"
237-
match: "(?<=[\\s()]|^)(:)[-+=*/\\w~!@$%^&:<>{}?]+"
238+
match: "(?<=[\\s()\\[]|^)(:)[-+=*/\\w~!@$%^&:<>{}?]+"
238239
captures:
239240
1: name: "punctuation.definition.keyword.emacs.lisp"
240241

@@ -264,7 +265,7 @@ repository:
264265
0: name: "punctuation.section.expression.end.emacs.lisp"
265266
patterns: [{
266267
name: "keyword.control.emacs.lisp"
267-
match: """(?x)(?<=[\\s()]|^)
268+
match: """(?x)(?<=[\\s()\\[]|^)
268269
(above|across|across-ref|always|and|append|as|below|by|collect|concat
269270
|count|do|each|finally|for|from|if|in|in-ref|initially|into|maximize
270271
|minimize|named|nconc|never|of|of-ref|on|repeat|return|sum|then|thereis
@@ -312,21 +313,21 @@ repository:
312313

313314
# #b10010110: Binary notation
314315
name: "constant.numeric.integer.binary.emacs.lisp"
315-
match: "(?<=[\\s()]|^)(#)[Bb][01]+"
316+
match: "(?<=[\\s()\\[]|^)(#)[Bb][01]+"
316317
captures: 1: name: "punctuation.definition.binary.emacs.lisp"
317318
},{
318319
# 0xFFFF: Hexadecimal notation
319320
name: "constant.numeric.integer.hex.viml"
320-
match: "(?<=[\\s()]|^)(#)[Xx][0-9A-Fa-f]+"
321+
match: "(?<=[\\s()\\[]|^)(#)[Xx][0-9A-Fa-f]+"
321322
captures: 1: name: "punctuation.definition.hex.emacs.lisp"
322323
},{
323324
# Float
324325
name: "constant.numeric.float.emacs.lisp"
325-
match: "(?<=[\\s()]|^)[-+]?\\d*\\.\\d+(?:[Ee][-+]?\\d+|[Ee]\\+(?:INF|NaN))?(?=[\\s()]|$)"
326+
match: "(?<=[\\s()\\[]|^)[-+]?\\d*\\.\\d+(?:[Ee][-+]?\\d+|[Ee]\\+(?:INF|NaN))?(?=[\\s()]|$)"
326327
},{
327328
# Integer
328329
name: "constant.numeric.integer.emacs.lisp"
329-
match: "(?<=[\\s()]|^)[-+]?\\d+(?:[Ee][-+]?\\d+|[Ee]\\+(?:INF|NaN))?(?=[\\s()]|$)"
330+
match: "(?<=[\\s()\\[]|^)[-+]?\\d+(?:[Ee][-+]?\\d+|[Ee]\\+(?:INF|NaN))?(?=[\\s()]|$)"
330331
}]
331332

332333

@@ -405,12 +406,12 @@ repository:
405406
symbols:
406407
patterns: [{
407408
name: "constant.other.interned.blank.symbol.emacs.lisp"
408-
match: "(?<=[\\s()]|^)##"
409+
match: "(?<=[\\s()\\[]|^)##"
409410
captures:
410411
0: name: "punctuation.definition.symbol.emacs.lisp"
411412
},{
412413
name: "constant.other.symbol.emacs.lisp"
413-
match: "(?<=[\\s()]|^)(#)((?:[-'+=*/\\w~!@$%^&:<>{}?]|\\\\.)+)"
414+
match: "(?<=[\\s()\\[]|^)(#)((?:[-'+=*/\\w~!@$%^&:<>{}?]|\\\\.)+)"
414415
captures:
415416
1: name: "punctuation.definition.symbol.emacs.lisp"
416417
2: patterns: [include: "$self"]
@@ -422,6 +423,15 @@ repository:
422423
1: name: "punctuation.definition.spliced.symbol.emacs.lisp"
423424
}]
424425

426+
427+
# [Vector lists]
428+
vectors:
429+
patterns: [
430+
{match: "\\[", name: "punctuation.section.vector.begin.emacs.lisp"}
431+
{match: "\\]", name: "punctuation.section.vector.end.emacs.lisp"}
432+
]
433+
434+
425435

426436
# Emacs standard library
427437
stdlib:

0 commit comments

Comments
 (0)