grammar: rename comment blocks

This commit is contained in:
Dmitriy Pleshevskiy 2023-01-07 21:55:42 +03:00
parent 8a50f066ab
commit cc6fa3e0f7
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
5 changed files with 258 additions and 258 deletions

View File

@ -1,7 +1,7 @@
module.exports = grammar({ module.exports = grammar({
name: "plpgsql", name: "plpgsql",
extras: ($) => [/\s\n/, /\s/, $.comment, $.marginalia], extras: ($) => [/\s\n/, /\s/, $.line_comment, $.block_comment],
conflicts: ($) => [[$.keyword_char, $.keyword_varchar]], conflicts: ($) => [[$.keyword_char, $.keyword_varchar]],
@ -239,9 +239,9 @@ module.exports = grammar({
// ------- // -------
comment: (_) => seq("--", /.*\n/), line_comment: (_) => seq("--", /.*\n/),
// https://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment // https://stackoverflow.com/questions/13014947/regex-to-match-a-c-style-multiline-comment
marginalia: (_) => seq("/*", /[^*]*\*+(?:[^/*][^*]*\*+)*/, "/"), block_comment: (_) => seq("/*", /[^*]*\*+(?:[^/*][^*]*\*+)*/, "/"),
_literal_string: ($) => choice(seq("'", /[^']*/, "'")), _literal_string: ($) => choice(seq("'", /[^']*/, "'")),
_number: (_) => /\d+/, _number: (_) => /\d+/,

View File

@ -1119,7 +1119,7 @@
"type": "PATTERN", "type": "PATTERN",
"value": "jsonb|JSONB" "value": "jsonb|JSONB"
}, },
"comment": { "line_comment": {
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
{ {
@ -1132,7 +1132,7 @@
} }
] ]
}, },
"marginalia": { "block_comment": {
"type": "SEQ", "type": "SEQ",
"members": [ "members": [
{ {
@ -1217,11 +1217,11 @@
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "comment" "name": "line_comment"
}, },
{ {
"type": "SYMBOL", "type": "SYMBOL",
"name": "marginalia" "name": "block_comment"
} }
], ],
"conflicts": [ "conflicts": [

View File

@ -1,4 +1,9 @@
[ [
{
"type": "block_comment",
"named": true,
"fields": {}
},
{ {
"type": "char", "type": "char",
"named": true, "named": true,
@ -206,11 +211,6 @@
] ]
} }
}, },
{
"type": "comment",
"named": true,
"fields": {}
},
{ {
"type": "create_table", "type": "create_table",
"named": true, "named": true,
@ -334,6 +334,11 @@
"named": true, "named": true,
"fields": {} "fields": {}
}, },
{
"type": "line_comment",
"named": true,
"fields": {}
},
{ {
"type": "literal", "type": "literal",
"named": true, "named": true,
@ -357,11 +362,6 @@
] ]
} }
}, },
{
"type": "marginalia",
"named": true,
"fields": {}
},
{ {
"type": "numeric", "type": "numeric",
"named": true, "named": true,

File diff suppressed because it is too large Load Diff

Binary file not shown.