@@ -19,50 +19,46 @@ variables:
1919 regexp_name : ' [a-zA-Z][a-zA-Z0-9]*'
2020contexts :
2121 main :
22- - include : comma
23- - include : line_comment
24- - include : reader_comment
25- - include : metadata
26- - include : quote
27- - include : syntax_quote
28- - include : syntax_unquote
29- - include : deref
22+ - include : skip_forms
23+ - include : wrap_forms
3024 - match : (?=\S)
31- push : forms
25+ push :
26+ - include : forms
3227
3328 forms :
29+ - include : skip_forms
30+ - include : wrap_forms
31+ - include : normal_forms
32+ - include : stray_bracket
33+
34+ deep_forms :
35+ - include : skip_forms
36+ - include : deep_normal_forms
37+ - include : stray_bracket
38+
39+
40+ # SKIP FORMS
41+
42+ skip_forms :
3443 - include : comma
44+ - include : deref
45+ - include : var
3546 - include : line_comment
3647 - include : reader_comment
3748 - include : metadata
38- - include : quote
39- - include : syntax_quote
40- - include : syntax_unquote
41- - include : deref
42- - include : character
43- - include : string
44- - include : regexp
45- - include : constant
46- - include : keyword
47- - include : integer
48- - include : float
49- - include : ratio
50- - include : symbol_unused
51- - include : symbol
52- - include : var
53- - include : list
54- - include : anonymous_fn
55- - include : reader_conditional
56- - include : vector
57- - include : map
58- - include : set
59- - include : tag
60- - include : stray_bracket
6149
6250 comma :
6351 - match : ' ,'
6452 scope : punctuation.definition.comma.clojure
6553
54+ deref :
55+ - match : ' @'
56+ scope : keyword.operator.deref.clojure
57+
58+ var :
59+ - match : ' #'' '
60+ scope : punctuation.definition.var.clojure
61+
6662 line_comment :
6763 - match : ' (;+).*$'
6864 scope : comment.line.clojure
@@ -83,6 +79,13 @@ contexts:
8379 - meta_scope : meta.metadata.clojure
8480 - include : forms
8581
82+ # WRAP FORMS
83+
84+ wrap_forms :
85+ - include : quote
86+ - include : syntax_quote
87+ - include : syntax_unquote
88+
8689 quote :
8790 - match : ' '' '
8891 scope : keyword.operator.quote.clojure
@@ -104,12 +107,27 @@ contexts:
104107 - meta_scope : meta.unquoted.clojure
105108 - include : forms
106109
107- deref :
108- - match : ' @'
109- scope : keyword.operator.deref.clojure
110- push :
111- - meta_scope : meta.deref.clojure
112- - include : forms
110+
111+ # NORMAL FORMS
112+
113+ normal_forms :
114+ - include : character
115+ - include : string
116+ - include : regexp
117+ - include : constant
118+ - include : keyword
119+ - include : integer
120+ - include : float
121+ - include : ratio
122+ - include : symbol_unused
123+ - include : symbol
124+ - include : list
125+ - include : anonymous_fn
126+ - include : reader_conditional
127+ - include : vector
128+ - include : map
129+ - include : set
130+ - include : tag
113131
114132 character :
115133 - match : ' {{wsb}}((\\)(u\h{4}|o[0-3]?[0-7]{1,2}|newline|tab|space|backspace|formfeed|return|[^\s]){{wse}}|((\\){{nwse}}*))'
@@ -274,30 +292,6 @@ contexts:
274292 2 : punctuation.definition.namespace.clojure
275293 pop : 1
276294
277- var :
278- - match : ' #'' '
279- scope : punctuation.definition.var.clojure
280- push :
281- - meta_scope : meta.var.clojure
282- - include : symbol
283- - include : comma
284- - include : fail
285-
286- tag :
287- - match : ' {{wsb}}(#inst\s*"\d\d\d\d(?:-[01]\d(?:-[0123]\d(?:T[012]\d(?::[012345]\d(?::[0123456]\d(?:[.]\d{1,9})?)?)?)?)?)?(?:Z|[-+][012]\d:[012345]\d)?"|(#inst\s*"[^"]*")){{wse}}'
288- scope : constant.other.instant.clojure
289- captures :
290- 2 : invalid.illegal.instant.clojure
291- pop : 1
292- - match : ' {{wsb}}(#uuid\s*"\h{8}-\h{4}-\h{4}-\h{4}-\h{12}"|(#uuid\s*"[^"]*")){{wse}}'
293- scope : constant.other.uuid.clojure
294- captures :
295- 2 : invalid.illegal.uuid.clojure
296- pop : 1
297- - match : ' {{wsb}}#(?![_#{])(?:{{symbol}}|{{ns_symbol}}(/){{symbol}}){{wse}}'
298- scope : storage.type.tag.clojure
299- pop : 1
300-
301295 list :
302296 - match : ' (?=\()'
303297 branch_point : open_parens
@@ -379,23 +373,20 @@ contexts:
379373 - meta_scope : meta.parens.clojure meta.function.anon.clojure
380374 - match : \)
381375 scope : punctuation.section.parens.end.clojure
382- pop : 2
376+ pop : 2
383377 - include : main
384378
385379 reader_conditional :
386- - match : ' #\?@?'
387- scope : punctuation.definition.reader_conditional.clojure punctuation.section.parens.begin.clojure
380+ - match : ' (#\?@?)\s*\('
381+ captures :
382+ 1 : punctuation.definition.reader_conditional.clojure
383+ scope : punctuation.section.parens.begin.clojure
388384 push :
389- - meta_scope : meta.reader_conditional.clojure meta.parens.clojure
390- - include : comma
391- - match : ' \('
392- scope : punctuation.section.parens.begin.clojure
393- push :
394- - match : ' \)'
395- scope : punctuation.section.parens.end.clojure
396- pop : 3
397- - include : main
398- - include : fail
385+ - meta_scope : meta.parens.clojure meta.reader_conditional.clojure
386+ - match : ' \)'
387+ scope : punctuation.section.parens.end.clojure
388+ pop : 2
389+ - include : main
399390
400391 vector :
401392 - match : \[
@@ -427,6 +418,47 @@ contexts:
427418 pop : 2
428419 - include : main
429420
421+ tag :
422+ - match : ' {{wsb}}(#inst\s*"\d\d\d\d(?:-[01]\d(?:-[0123]\d(?:T[012]\d(?::[012345]\d(?::[0123456]\d(?:[.]\d{1,9})?)?)?)?)?)?(?:Z|[-+][012]\d:[012345]\d)?"|(#inst\s*"[^"]*")){{wse}}'
423+ scope : constant.other.instant.clojure
424+ captures :
425+ 2 : invalid.illegal.instant.clojure
426+ pop : 1
427+ - match : ' {{wsb}}(#uuid\s*"\h{8}-\h{4}-\h{4}-\h{4}-\h{12}"|(#uuid\s*"[^"]*")){{wse}}'
428+ scope : constant.other.uuid.clojure
429+ captures :
430+ 2 : invalid.illegal.uuid.clojure
431+ pop : 1
432+ - match : ' {{wsb}}#(?![_#{])(?:{{symbol}}|{{ns_symbol}}(/){{symbol}}){{wse}}'
433+ scope : storage.type.tag.clojure
434+ pop : 1
435+
436+
437+ # DEEP FORMS
438+
439+ deep_normal_forms :
440+ - include : deep_character
441+ - include : deep_string
442+ - include : deep_regexp
443+ - include : deep_constant
444+ - include : deep_keyword
445+ - include : deep_integer
446+ - include : deep_float
447+ - include : deep_ratio
448+ - include : deep_symbol_unused
449+ - include : deep_symbol
450+ - include : deep_var
451+ - include : deep_list
452+ - include : deep_anonymous_fn
453+ - include : deep_reader_conditional
454+ - include : deep_vector
455+ - include : deep_map
456+ - include : deep_set
457+ - include : deep_tag
458+
459+
460+ # ERRORS
461+
430462 stray_bracket :
431463 - match : ' [\]\)\}]'
432464 scope : invalid.illegal.stray-bracket-end
0 commit comments