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

CamlP4 does not like a pattern like [p;] #4938

Closed
vicuna opened this issue Dec 14, 2009 · 2 comments
Closed

CamlP4 does not like a pattern like [p;] #4938

vicuna opened this issue Dec 14, 2009 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Dec 14, 2009

Original bug ID: 4938
Reporter: furuse
Assigned to: ertai
Status: closed (set by @xavierleroy on 2012-03-24T14:01:46Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.11.1
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Monitored by: Gabriel @ygrek

Bug description

The following OCaml-valid pattern is rejected by CamlP4:

let f [ 0; ] = 0

The following patch should fix the problem, though it has a dup code:

--- a/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
+++ b/camlp4/Camlp4Parsers/Camlp4OCamlRevisedParser.ml
@@ -904,6 +904,7 @@
;
sem_patt_for_list:
[ [ p = patt; ";"; pl = SELF -> fun acc -> <:patt< [ $p$ :: $pl acc$ ] >>

  •    | p = patt; ";" -> fun acc -> <:patt< [ $p$ :: $acc$ ] >>
       | p = patt -> fun acc -> <:patt< [ $p$ :: $acc$ ] >>
     ] ]
    
    ;
@vicuna
Copy link
Author

vicuna commented Feb 10, 2010

Comment author: Gabriel

There's the same problem with arrays:

camlp4o -str 'let [| x; |] = [| 5; |]'

@vicuna
Copy link
Author

vicuna commented Jun 16, 2010

Comment author: ertai

Fixed. Thanks for the report.

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