Fix pattern defs for pascaligo

This commit is contained in:
Kirill Andreev 2020-08-24 14:17:53 +04:00
parent f554551f75
commit 5533b07270
No known key found for this signature in database
GPG Key ID: CF7DA79DE4785A47
4 changed files with 8 additions and 5 deletions

View File

@ -41,7 +41,7 @@ type action =
| GetTotalSupply ( getTotalSupply )
let transfer = ((p,s) : (transfer, storage)) : (list (operation), storage) => {
let new_allowances =
let new_allowances =
if (Tezos.sender == p.address_from) { s.allowances; }
else {
let authorized_value = switch (Big_map.find_opt ((Tezos.sender,p.address_from), s.allowances)) {
@ -105,7 +105,7 @@ let getTotalSupply = ((p,s) : (getTotalSupply, storage)) : (list (operation), st
};
let main = ((a,s): (action, storage)) =>
let main = ((a,s): (action, storage)) =>
switch a {
| Transfer p => transfer ((p,s))
| Approve p => approve ((p,s))

View File

@ -188,7 +188,7 @@ eventLoop funs chan = do
respondWith funs req RspFindReferences $ J.List []
ReqCompletion req -> do
stopDyingAlready funs req $ do
stopDyingAlready funs req $ do
U.logs $ "got completion request: " <> show req
let uri = req ^. J.params . J.textDocument . J.uri
let pos = posToRange $ req ^. J.params . J.position
@ -198,7 +198,7 @@ eventLoop funs chan = do
-- Additional callback executed after completion was made, currently no-op
ReqCompletionItemResolve req -> do
stopDyingAlready funs req $ do
stopDyingAlready funs req $ do
U.logs $ "got completion resolve request: " <> show req
respondWith funs req RspCompletionItemResolve (req ^. J.params)

View File

@ -733,7 +733,7 @@ module.exports = grammar({
_core_pattern: $ =>
choice(
$.Name,
$.var_pattern,
'_',
$.Int,
$.Nat,
@ -743,6 +743,8 @@ module.exports = grammar({
$._constr_pattern,
),
var_pattern: $ => field("name", $.Name),
_list_pattern: $ =>
choice(
$.list_pattern,

View File

@ -115,6 +115,7 @@ recognise = descent (error "Reasonligo.recognise") $ map usingScope
"nil" -> return $ IsList []
"list_pattern" -> IsList <$> fields "element"
"cons_pattern" -> IsCons <$> field "head" <*> field "tail"
"var_pattern" -> IsVar <$> field "name"
_ -> fallthrough
-- Alt