summaryrefslogtreecommitdiff
path: root/language
diff options
context:
space:
mode:
authorGabriel Kerneis2013-08-19 17:16:51 +0100
committerGabriel Kerneis2013-08-19 17:16:51 +0100
commit797cefdfd99d9b5ee4a1f619610b5bb52692f443 (patch)
tree1854bcf270587c8167d6fc3994ab028bfd9a9733 /language
parent0372f89b3a4d805b3cfdb7910eb6206e1e2133a2 (diff)
language.ott: syntax for types in patterns
Diffstat (limited to 'language')
-rw-r--r--language/l2.ott4
-rw-r--r--language/l2_parse.ott2
2 files changed, 4 insertions, 2 deletions
diff --git a/language/l2.ott b/language/l2.ott
index 85a17917..38f25b52 100644
--- a/language/l2.ott
+++ b/language/l2.ott
@@ -541,7 +541,8 @@ pat :: 'P_' ::=
% | ( pat : typ ) :: :: typ
% {{ com Typed patterns }}
% C-style
- | ( typ pat ) :: :: typ
+% XXX < > are necessary to make the grammar non ambiguous
+ | ( < typ > pat ) :: :: typ
{{ com typed pattern }}
| id :: :: id
@@ -583,6 +584,7 @@ pat :: 'P_' ::=
% | id '+' num :: :: num_add
% {{ com constant addition patterns }}
+% XXX Is this still useful?
fpat :: 'FP_' ::=
{{ com Field pattern }}
{{ aux _ annot }} {{ auxparam 'a }}
diff --git a/language/l2_parse.ott b/language/l2_parse.ott
index 99465f65..20b6ef2b 100644
--- a/language/l2_parse.ott
+++ b/language/l2_parse.ott
@@ -521,7 +521,7 @@ pat :: 'P_' ::=
% | ( pat : typ ) :: :: typ
% {{ com Typed patterns }}
% C-style
- | ( atyp pat ) :: :: typ
+ | ( < atyp > pat ) :: :: typ
{{ com typed pattern }}
| id :: :: id