diff --git a/flake.lock b/flake.lock index 197a9a8..77f47b2 100644 --- a/flake.lock +++ b/flake.lock @@ -32,16 +32,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1686737040, - "narHash": "sha256-R+JicNaI9mcxodtHkci894txjt4IMsfOnlAarA/r0xQ=", + "lastModified": 1686736559, + "narHash": "sha256-YyUSVoOKIDAscTx7IZhF9x3qgZ9dPNF19fKk+4c5irc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6d1d80a232a355a65dc4d3bfea1f108e8dac1340", + "rev": "ddf4688dc7aeb14e8a3c549cb6aa6337f187a884", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixpkgs-unstable", + "ref": "nixos-23.05", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index e6d9597..7470b53 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; flake-utils.url = "github:numtide/flake-utils"; tools.url = "git+https://git.pleshevski.ru/mynix/tools"; }; diff --git a/queries/highlights.scm b/queries/highlights.scm index 9484360..a822220 100644 --- a/queries/highlights.scm +++ b/queries/highlights.scm @@ -27,9 +27,11 @@ ; Comments ;------------------------------------------------------------------------------- -(language) @comment -(line_comment) @comment.line -(block_comment) @comment.block +[ + (language) + (line_comment) + (block_comment) +] @comment ; Punctiation ;------------------------------------------------------------------------------- diff --git a/src/grammar.json b/src/grammar.json index d8f6a17..3e39c07 100644 --- a/src/grammar.json +++ b/src/grammar.json @@ -2080,7 +2080,20 @@ "type": "PATTERN", "value": "[0-9]+\\.[0-9]+" }, - "line_comment": { + "comment": { + "type": "CHOICE", + "members": [ + { + "type": "SYMBOL", + "name": "_line_comment" + }, + { + "type": "SYMBOL", + "name": "_block_comment" + } + ] + }, + "_line_comment": { "type": "TOKEN", "content": { "type": "PREC", @@ -2137,11 +2150,7 @@ }, { "type": "SYMBOL", - "name": "line_comment" - }, - { - "type": "SYMBOL", - "name": "block_comment" + "name": "comment" } ], "conflicts": [ @@ -2187,7 +2196,7 @@ }, { "type": "SYMBOL", - "name": "block_comment" + "name": "_block_comment" } ], "inline": [], diff --git a/src/node-types.json b/src/node-types.json index ed28446..18d3460 100644 --- a/src/node-types.json +++ b/src/node-types.json @@ -232,6 +232,11 @@ ] } }, + { + "type": "comment", + "named": true, + "fields": {} + }, { "type": "connection", "named": true, @@ -508,10 +513,6 @@ "type": "arrow", "named": true }, - { - "type": "block_comment", - "named": true - }, { "type": "bold", "named": false @@ -620,10 +621,6 @@ "type": "language", "named": true }, - { - "type": "line_comment", - "named": true - }, { "type": "link", "named": false diff --git a/src/parser.c b/src/parser.c index be8e37c..d296682 100644 Binary files a/src/parser.c and b/src/parser.c differ