[LIGO-47] PascaLIGO: Move block out of case_block alternatives

Problem: In multisig.ligo:48, the case alternative block is
interpreted as empty, while it is not. This happens because
PascaLIGO parser expects to find `fields "statements"` inside
a `case_block`. In practice, if a `case_block` contains a `block`,
statements are deeper in the hierarchy, and get ignored.

Solution: Move "block" option out of the "case_block"
(to _if_clause).
This commit is contained in:
Kirill Kuvshinov 2020-09-15 11:25:21 +03:00
parent 04724a1db2
commit c44a35d4d1
No known key found for this signature in database
GPG Key ID: 3705CDC3F29E4DAF

View File

@ -363,13 +363,11 @@ module.exports = grammar({
choice(
$._instruction,
$.clause_block,
$.block,
),
clause_block: $ =>
choice(
field("block", $.block),
seq('{', sepBy1(';', field("statement", $._statement)), '}')
),
seq('{', sepBy1(';', field("statement", $._statement)), '}'),
block: $ =>
choice(
@ -822,4 +820,4 @@ module.exports = grammar({
skip: $ => 'skip',
recursive: $ => 'recursive',
}
});
});