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

@ -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