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

Comments

Projects
None yet
1 participant
@vicuna
Copy link
Collaborator

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 Aug 31, 2013

@vicuna vicuna added camlp4 bug labels Mar 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.