Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ module.exports = grammar({

externals: ($) => [
$._newline,
$.comment,
$._newline_and_comment,
$.block_comment,
'"',
"`",
$._template_chars,
Expand All @@ -18,7 +17,12 @@ module.exports = grammar({
$._decorator_inline,
],

extras: ($) => [$.comment, $.decorator, /[\s\uFEFF\u2060\u200B\u00A0]/],
extras: ($) => [
$.block_comment,
$.line_comment,
$.decorator,
/[\s\uFEFF\u2060\u200B\u00A0]/,
],

supertypes: ($) => [
$.statement,
Expand Down Expand Up @@ -121,8 +125,9 @@ module.exports = grammar({

_statement: ($) => seq($.statement, repeat1($._statement_delimeter)),

_statement_delimeter: ($) =>
choice(";", $._newline, alias($._newline_and_comment, $.comment)),
_statement_delimeter: ($) => choice(";", $._newline),

line_comment: ($) => token(seq("//", /[^\n]*/)),

_one_or_more_statements: ($) =>
seq(repeat($._statement), $.statement, optional($._statement_delimeter)),
Expand Down
5 changes: 4 additions & 1 deletion queries/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
(comment) @comment
[
(line_comment)
(block_comment)
] @comment

; Identifiers
;------------
Expand Down
5 changes: 4 additions & 1 deletion queries/injections.scm
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
((comment) @injection.content (#set! injection.language "comment"))
([
(line_comment)
(block_comment)
] @injection.content (#set! injection.language "comment"))

; regex literal
(regex
Expand Down
5 changes: 4 additions & 1 deletion queries/textobjects.scm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@
; Comments
;---------

(comment) @comment.outer
[
(line_comment)
(block_comment)
] @comment.outer

; Parameters
;-----------
Expand Down
37 changes: 22 additions & 15 deletions src/grammar.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 10 additions & 25 deletions src/node-types.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading