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] parsing bug with labels #8307

Closed
vicuna opened this issue Sep 30, 2003 · 3 comments
Closed

[camlp4] parsing bug with labels #8307

vicuna opened this issue Sep 30, 2003 · 3 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Sep 30, 2003

Original bug ID: 1860
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Bonjour,

Apparemment camlp4 a des problèmes avec certains labels :

,----
| $ cat a.ml
| external a : bla:unit -> bli:unit -> unit = "truc"
| $ ocamlc -v
| The Objective Caml compiler, version 3.07
| Standard library directory: /home/oliv/usr/lib/ocaml
| $ ocamlc -c -i -pp camlp4o a.ml
| File "a.ml", line 1, characters 28-29:
| Parse error: '=' expected after [type] (in [str_item])
| Preprocessor error
`----

Après un (trés rapide) coup d'oeuil au code j'ai changé ceci et ça
remarche :

--- camlp4/etc/pa_o.ml~ 2003-09-25 14:05:05.000000000 +0200
+++ camlp4/etc/pa_o.ml 2003-09-30 03:40:04.000000000 +0200
@@ -1149,7 +1149,7 @@
;
(* Labels *)
ctyp: AFTER "arrow"

  • [ NONA
  • [ RIGHTA
    [ i = lident_colon; t1 = ctyp LEVEL "star"; "->"; t2 = SELF ->
    <:ctyp< ~ $i$ : $t1$ -> $t2$ >>
    | i = OPTLABEL; t1 = ctyp LEVEL "star"; "->"; t2 = SELF ->

--
Olivier

@vicuna
Copy link
Author

vicuna commented Sep 30, 2003

Comment author: administrator

From: oandrieu@nerim.net

Apparemment camlp4 a des problemes avec certains labels :
[...]
Apres un (tres rapide) coup d'oeuil au code j'ai change ceci et ca
remarche :

J'ai essaye' ton patch, mais ca ne semble pas resoudre tous les
problemes.

    Camlp4 Parsing version 3.07

fun (f : ?x:int -> bool -> float) -> f ;;

  • : ((?x:int -> bool) -> float) -> (?x:int -> bool) -> float =

Malheureusement je ne m'y connais pas assez en camlp4 pour savoir
comment corriger...

Jacques

@vicuna
Copy link
Author

vicuna commented Sep 30, 2003

Comment author: administrator

Merci pour le rapport, et le fix partiel. C'est réparé dans le CVS (à
paraître demain matin), ainsi que le bug souligné par Jacques dans sa
réponse.

-- Michel

oandrieu@nerim.net wrote/écrivait (Tue, Sep 30, 2003 at 03:48:34AM +0200):

Bonjour,

Apparemment camlp4 a des problèmes avec certains labels :

,----
| $ cat a.ml
| external a : bla:unit -> bli:unit -> unit = "truc"
| $ ocamlc -v
| The Objective Caml compiler, version 3.07
| Standard library directory: /home/oliv/usr/lib/ocaml
| $ ocamlc -c -i -pp camlp4o a.ml
| File "a.ml", line 1, characters 28-29:
| Parse error: '=' expected after [type] (in [str_item])
| Preprocessor error
`----

Après un (trés rapide) coup d'oeuil au code j'ai changé ceci et ça
remarche :

--- camlp4/etc/pa_o.ml~ 2003-09-25 14:05:05.000000000 +0200
+++ camlp4/etc/pa_o.ml 2003-09-30 03:40:04.000000000 +0200
@@ -1149,7 +1149,7 @@
;
(* Labels *)
ctyp: AFTER "arrow"

  • [ NONA
  • [ RIGHTA
    [ i = lident_colon; t1 = ctyp LEVEL "star"; "->"; t2 = SELF ->
    <:ctyp< ~ $i$ : $t1$ -> $t2$ >>
    | i = OPTLABEL; t1 = ctyp LEVEL "star"; "->"; t2 = SELF ->

--
Olivier

@vicuna
Copy link
Author

vicuna commented Sep 30, 2003

Comment author: administrator

Fixed by MM, 2003/09/30.

@vicuna vicuna closed this as completed Sep 30, 2003
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant