diff options
| author | msozeau | 2008-07-04 14:38:44 +0000 |
|---|---|---|
| committer | msozeau | 2008-07-04 14:38:44 +0000 |
| commit | ff03e8dd0de507be82e58ed5e8fd902dfd7caf4b (patch) | |
| tree | ede6bccf7f4dbcca84e5aca8a374b444527c1686 /parsing/g_constr.ml4 | |
| parent | e4b265c5f51fbaf87054d13c036878964a98cfcd (diff) | |
Fixes in handling of implicit arguments:
- Now [ id : Class foo ] makes id an explicit argument,
and [ Class foo ] is equivalent to [ {someid} : Class foo ].
This makes declarations such as "Class Ord [ eq : Eq a ]" have
sensible implicit args.
- Better handling of {} in class and record declarations, refactorize
code for declaring structures and classes.
- Fix merging of implicit arguments information on section closing.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@11204 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'parsing/g_constr.ml4')
| -rw-r--r-- | parsing/g_constr.ml4 | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/parsing/g_constr.ml4 b/parsing/g_constr.ml4 index 6b6b4871cf..3f437721a8 100644 --- a/parsing/g_constr.ml4 +++ b/parsing/g_constr.ml4 @@ -409,17 +409,19 @@ GEXTEND Gram ; typeclass_constraint_binder: [ [ tc = typeclass_constraint -> - let (n,bk,t) = tc in - LocalRawAssum ([n], TypeClass bk, t) + let (n,(b,b'),t) = tc in + LocalRawAssum ([n], TypeClass (b,b'), t) ] ] ; typeclass_constraint: - [ [ "!" ; c = operconstr LEVEL "200" -> (loc, Anonymous), Explicit, c - | iid=ident_colon ; expl = [ "!" -> Explicit | -> Implicit ] ; c = operconstr LEVEL "200" -> - (loc, Name iid), expl, c - | c = operconstr LEVEL "200" -> - (loc, Anonymous), Implicit, c + [ [ "!" ; c = operconstr LEVEL "200" -> (loc, Anonymous), (Implicit, Explicit), c + | "{"; id = name; "}"; ":" ; expl = [ "!" -> Explicit | -> Implicit ] ; c = operconstr LEVEL "200" -> + id, (Implicit, expl), c + | iid=ident_colon ; expl = [ "!" -> Explicit | -> Implicit ] ; c = operconstr LEVEL "200" -> + (loc, Name iid), (Explicit, expl), c + | c = operconstr LEVEL "200" -> + (loc, Anonymous), (Implicit, Implicit), c ] ] ; |
