Merge branch 'kkirka/ligo47-fix-incorrect-parsing' into 'tooling'

[LIGO-47] Fix incorrect parsing of lambdas and case clauses

See merge request serokell/ligo/ligo!19
This commit is contained in:
Kirill Kuvshinov 2020-09-15 08:35:45 +00:00
commit ee86539685
2 changed files with 4 additions and 6 deletions

View File

@ -229,7 +229,7 @@ module.exports = grammar({
"fun", "fun",
repeat1(field("arg", $._paren_pattern)), repeat1(field("arg", $._paren_pattern)),
"->", "->",
field("body", $._expr) field("body", $._program)
), ),
list_expr: $ => seq( list_expr: $ => seq(

View File

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