From 797cefdfd99d9b5ee4a1f619610b5bb52692f443 Mon Sep 17 00:00:00 2001 From: Gabriel Kerneis Date: Mon, 19 Aug 2013 17:16:51 +0100 Subject: language.ott: syntax for types in patterns --- language/l2.ott | 4 +++- language/l2_parse.ott | 2 +- 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 -- cgit v1.2.3