Fix pattern defs for pascaligo
This commit is contained in:
parent
f554551f75
commit
5533b07270
@ -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