Fix pattern defs for pascaligo
This commit is contained in:
parent
f554551f75
commit
5533b07270
@ -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))
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user