Fix pattern defs for pascaligo
This commit is contained in:
parent
f554551f75
commit
5533b07270
@ -41,7 +41,7 @@ type action =
|
|||||||
| GetTotalSupply ( getTotalSupply )
|
| GetTotalSupply ( getTotalSupply )
|
||||||
|
|
||||||
let transfer = ((p,s) : (transfer, storage)) : (list (operation), storage) => {
|
let transfer = ((p,s) : (transfer, storage)) : (list (operation), storage) => {
|
||||||
let new_allowances =
|
let new_allowances =
|
||||||
if (Tezos.sender == p.address_from) { s.allowances; }
|
if (Tezos.sender == p.address_from) { s.allowances; }
|
||||||
else {
|
else {
|
||||||
let authorized_value = switch (Big_map.find_opt ((Tezos.sender,p.address_from), s.allowances)) {
|
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 {
|
switch a {
|
||||||
| Transfer p => transfer ((p,s))
|
| Transfer p => transfer ((p,s))
|
||||||
| Approve p => approve ((p,s))
|
| Approve p => approve ((p,s))
|
||||||
|
@ -188,7 +188,7 @@ eventLoop funs chan = do
|
|||||||
respondWith funs req RspFindReferences $ J.List []
|
respondWith funs req RspFindReferences $ J.List []
|
||||||
|
|
||||||
ReqCompletion req -> do
|
ReqCompletion req -> do
|
||||||
stopDyingAlready funs req $ do
|
stopDyingAlready funs req $ do
|
||||||
U.logs $ "got completion request: " <> show req
|
U.logs $ "got completion request: " <> show req
|
||||||
let uri = req ^. J.params . J.textDocument . J.uri
|
let uri = req ^. J.params . J.textDocument . J.uri
|
||||||
let pos = posToRange $ req ^. J.params . J.position
|
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
|
-- Additional callback executed after completion was made, currently no-op
|
||||||
ReqCompletionItemResolve req -> do
|
ReqCompletionItemResolve req -> do
|
||||||
stopDyingAlready funs req $ do
|
stopDyingAlready funs req $ do
|
||||||
U.logs $ "got completion resolve request: " <> show req
|
U.logs $ "got completion resolve request: " <> show req
|
||||||
respondWith funs req RspCompletionItemResolve (req ^. J.params)
|
respondWith funs req RspCompletionItemResolve (req ^. J.params)
|
||||||
|
|
||||||
|
@ -733,7 +733,7 @@ module.exports = grammar({
|
|||||||
|
|
||||||
_core_pattern: $ =>
|
_core_pattern: $ =>
|
||||||
choice(
|
choice(
|
||||||
$.Name,
|
$.var_pattern,
|
||||||
'_',
|
'_',
|
||||||
$.Int,
|
$.Int,
|
||||||
$.Nat,
|
$.Nat,
|
||||||
@ -743,6 +743,8 @@ module.exports = grammar({
|
|||||||
$._constr_pattern,
|
$._constr_pattern,
|
||||||
),
|
),
|
||||||
|
|
||||||
|
var_pattern: $ => field("name", $.Name),
|
||||||
|
|
||||||
_list_pattern: $ =>
|
_list_pattern: $ =>
|
||||||
choice(
|
choice(
|
||||||
$.list_pattern,
|
$.list_pattern,
|
||||||
|
@ -115,6 +115,7 @@ recognise = descent (error "Reasonligo.recognise") $ map usingScope
|
|||||||
"nil" -> return $ IsList []
|
"nil" -> return $ IsList []
|
||||||
"list_pattern" -> IsList <$> fields "element"
|
"list_pattern" -> IsList <$> fields "element"
|
||||||
"cons_pattern" -> IsCons <$> field "head" <*> field "tail"
|
"cons_pattern" -> IsCons <$> field "head" <*> field "tail"
|
||||||
|
"var_pattern" -> IsVar <$> field "name"
|
||||||
_ -> fallthrough
|
_ -> fallthrough
|
||||||
|
|
||||||
-- Alt
|
-- Alt
|
||||||
|
Loading…
Reference in New Issue
Block a user