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 patterns like: ?x:_ #4939

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

CamlP4 does not like patterns like: ?x:_ #4939

vicuna opened this issue Dec 14, 2009 · 0 comments

Comments

@vicuna
Copy link

vicuna commented Dec 14, 2009

Original bug ID: 4939
Reporter: furuse
Assigned to: ertai
Status: closed (set by @xavierleroy on 2013-08-31T10:46:15Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.11.1
Fixed in version: 3.12.1+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Monitored by: @ygrek "Hendrik Tews"

Bug description

Sorry for submitting small problems repeatedly.

let f ?l:_ () = ()

is rejected by camlp4o. The fix is :

--- a/camlp4/Camlp4Parsers/Camlp4OCamlParser.ml
+++ b/camlp4/Camlp4Parsers/Camlp4OCamlParser.ml
@@ -629,6 +629,8 @@
<:patt< ~ $i$ : ($lid:i$ : $t$) >>
| i = a_OPTLABEL; j = a_LIDENT -> (* ?a:b <> ?a : b *)
<:patt< ? $i$ : ($lid:j$) >>

  •    | i = a_OPTLABEL; "_" ->
    
  •        <:patt< ? $i$ : (_) >>
       | i = a_OPTLABEL; "("; p = patt; ")" ->
           <:patt< ? $i$ : ($p$) >>
       | i = a_OPTLABEL; "("; p = patt; "="; e = expr; ")" ->
    
@vicuna vicuna closed this as completed Aug 31, 2013
dra27 pushed a commit to dra27/ocaml that referenced this issue Feb 27, 2021
Patch provided by Furuse.


git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.12@11034 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
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