Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pattern syntax #3428

Closed
vicuna opened this issue Jan 12, 2005 · 1 comment
Closed

pattern syntax #3428

vicuna opened this issue Jan 12, 2005 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jan 12, 2005

Original bug ID: 3428
Reporter: administrator
Status: closed
Resolution: won't fix
Priority: normal
Severity: feature
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Jean-Christophe Filliâtre
Version: >= 3.08.1
OS: Linux
Submission from: pc8-142.lri.fr (129.175.8.142)

The ocaml grammar is accepting this:

match Some (Some 1) with Some Some x -> x

The pattern is interpreted as Some (Some x); but such a syntax should not be
accepted since it suggests either that constructors are curryfied functions or
that application is right associative.

There seems to be a simple patch: to replace pattern with simple_pattern in the
grammar rule for pattern (file parsing/parser.mly, line 1053):

| constr_longident pattern %prec prec_constr_appl
{ mkpat(Ppat_construct($1, Some $2, false)) }

But I didn't try this patch...

Best regards,

Jean-Christophe

@vicuna
Copy link
Author

vicuna commented Jan 28, 2005

Comment author: administrator

Full_Name: Jean-Christophe Filliâtre
Version: >= 3.08.1
OS: Linux
Submission from: pc8-142.lri.fr (129.175.8.142)

The ocaml grammar is accepting this:
match Some (Some 1) with Some Some x -> x
[...]
There seems to be a simple patch: to replace pattern with simple_pattern in
the
grammar rule for pattern (file parsing/parser.mly, line 1053):

| constr_longident pattern %prec prec_constr_appl
{ mkpat(Ppat_construct($1, Some $2, false)) }

But I didn't try this patch...

J'allais dire "wow, un changement de syntaxe qui ne casse pas Coq", mais
ca casse effectivement Coq. Nous n'implementerons pas ce changement
car le nettoyage de la grammaire n'est pas une raison suffisamment
importante pour justifier un changement incompatible.

-- Damien

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant