Fix a case with an empty body with comment(s)

This commit is contained in:
Andrew Hlynskyi
2023-04-08 15:26:24 +03:00
committed by Michael Hoffmann
parent 9903dc0b57
commit 4e33af0710
2 changed files with 25 additions and 6 deletions

View File

@@ -37,12 +37,15 @@ module.exports = function make_grammar(dialect) {
// also allow objects to handle .tfvars in json format
config_file: $ => optional(choice($.body, $.object)),
body: $ => seq(
optional($._shim),
repeat1(
choice(
$.attribute,
$.block,
body: $ => choice(
$._shim,
seq(
optional($._shim),
repeat1(
choice(
$.attribute,
$.block,
),
),
),
),