Skip to content

Commit bd7034b

Browse files
committed
Opening paren is not treated as comment by default
1 parent 5526d18 commit bd7034b

File tree

1 file changed

+34
-23
lines changed

1 file changed

+34
-23
lines changed

Clojure (Sublimed).sublime-syntax

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -277,32 +277,16 @@ contexts:
277277
pop: 1
278278

279279
list:
280-
- match: '\('
281-
scope: punctuation.section.parens.begin.clojure
280+
- match: '(?=\()'
282281
branch_point: open_parens
283282
branch:
284-
- form_comment_first
285-
- list_first
286-
287-
form_comment_first:
288-
- meta_scope: comment.form.clojure
289-
- include: comma
290-
- include: line_comment
291-
- include: reader_comment
292-
- include: metadata
293-
- match: 'comment'
294-
set: form_comment_rest
295-
- match: \)
296-
fail: open_parens
297-
- match: '(?=\S)'
298-
fail: open_parens
283+
- list_paren
284+
- form_comment_paren
299285

300-
form_comment_rest:
301-
- meta_scope: comment.form.clojure
302-
- match: \)
303-
scope: punctuation.section.parens.end.clojure
304-
pop: 2
305-
- include: main
286+
list_paren:
287+
- match: '\('
288+
scope: punctuation.section.parens.begin.clojure
289+
set: list_first
306290

307291
list_first:
308292
- meta_scope: meta.parens.clojure
@@ -313,6 +297,8 @@ contexts:
313297
- include: line_comment
314298
- include: reader_comment
315299
- include: metadata
300+
- match: 'comment'
301+
fail: open_parens
316302
- include: symbol_def
317303
- match: '(?=\S)'
318304
set: list_rest
@@ -337,6 +323,31 @@ contexts:
337323
pop: 2
338324
- include: main
339325

326+
form_comment_paren:
327+
- match: '\('
328+
scope: punctuation.section.parens.begin.clojure
329+
set: form_comment_first
330+
331+
form_comment_first:
332+
- meta_scope: comment.form.clojure
333+
- include: comma
334+
- include: line_comment
335+
- include: reader_comment
336+
- include: metadata
337+
- match: 'comment'
338+
set: form_comment_rest
339+
- match: \)
340+
fail: open_parens
341+
- match: '(?=\S)'
342+
fail: open_parens
343+
344+
form_comment_rest:
345+
- meta_scope: comment.form.clojure
346+
- match: \)
347+
scope: punctuation.section.parens.end.clojure
348+
pop: 2
349+
- include: main
350+
340351
symbol_def:
341352
- match: '{{wsb}}(?:(?=def){{symbol}}|({{ns_symbol}})(/)(?=def){{symbol}}){{wse}}'
342353
scope: source.symbol.def.clojure

0 commit comments

Comments
 (0)