Skip to content

Commit 4edfed9

Browse files
committed
Add bind_statement as new node
Allows capturing common block name
1 parent daa0d21 commit 4edfed9

File tree

5 files changed

+469288
-469108
lines changed

5 files changed

+469288
-469108
lines changed

grammar.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ module.exports = grammar({
561561
$.import_statement,
562562
$.public_statement,
563563
$.private_statement,
564+
$.bind_statement,
564565
$.enum,
565566
$.enumeration_type,
566567
$.namelist_statement,
@@ -640,15 +641,22 @@ module.exports = grammar({
640641

641642
save_statement: $ => prec(1, seq(
642643
caseInsensitive('save'),
643-
optional(seq(
644-
optional('::'),
645-
commaSep1(choice(
646-
$.identifier,
647-
seq('/', $.identifier, '/'),
648-
)),
649-
)),
644+
optional($._identifier_or_common_block),
650645
)),
651646

647+
bind_statement: $ => seq(
648+
$.language_binding,
649+
$._identifier_or_common_block,
650+
),
651+
652+
_identifier_or_common_block: $ => seq(
653+
optional('::'),
654+
commaSep1(choice(
655+
$.identifier,
656+
seq('/', alias($.identifier, $.common_block), '/'),
657+
)),
658+
),
659+
652660
private_statement: $ => prec.right(1, seq(
653661
caseInsensitive('private'),
654662
optional(seq(
@@ -863,7 +871,6 @@ module.exports = grammar({
863871
repeat1(choice(
864872
alias($._standalone_type_qualifier, $.type_qualifier),
865873
$.variable_attributes,
866-
$.language_binding,
867874
)),
868875
optional('::'),
869876
commaSep1(field('declarator', $._variable_declarator)),

0 commit comments

Comments
 (0)