From 04724a1db2135ea1511e1344d116e1747d1d4189 Mon Sep 17 00:00:00 2001 From: Kirill Kuvshinov Date: Tue, 15 Sep 2020 11:22:15 +0300 Subject: [PATCH] [LIGO-47] Allow `let .. in` in lambda body Problem: In multisig.mligo, else clause on line 36 ends on line 55, while it should end on line 80. This happens because of incorrect lambda parsing on lines 42-43. In particular, `let valid, keys = vk` in lambda body gets parsed as a `tuple (fun_app "let" "valid") (binary_op "=" "keys" "vk")`, and `in` is considered as a part of the outer `let`. Solution: Allow `_program` instead of `_expr` as the lambda body. --- tools/lsp/squirrel/grammar/camligo/grammar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lsp/squirrel/grammar/camligo/grammar.js b/tools/lsp/squirrel/grammar/camligo/grammar.js index e3d9fb638..483fb2817 100644 --- a/tools/lsp/squirrel/grammar/camligo/grammar.js +++ b/tools/lsp/squirrel/grammar/camligo/grammar.js @@ -229,7 +229,7 @@ module.exports = grammar({ "fun", repeat1(field("arg", $._paren_pattern)), "->", - field("body", $._expr) + field("body", $._program) ), list_expr: $ => seq(