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 parser error #3174

Closed
vicuna opened this issue Jan 28, 2002 · 2 comments
Closed

camlp4 parser error #3174

vicuna opened this issue Jan 28, 2002 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Jan 28, 2002

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

Bug description

Hi,

applying camlp4 to the lablgtk sources gives the following
errors:

ithif51 src 41> camlp4o pr_o.cmo gDraw.mli
File "gDraw.mli", line 66, characters 42-43:
Parse error: [type] expected after '[' (in [class_signature])

ithif51 src 42> camlp4o pr_o.cmo gObj.mli
File "gObj.mli", line 35, characters 18-19:
Parse error: [type] expected after '[' (in [class_signature])

I also saw a few problems in the camlp4 reference manual:

  • appendix A.11 is about class_sig_item, but the quotation there
    is class_type.

  • class_str_item is missing in appendix A.

I would also suggest to place more type information in appendix
A. For instance in A.2 there is the line

 <:expr< match $e$ with [ $list:pwel$ ] >>: match statement

If I want to use this quotation then I have to know the type of
the antiquotations e and pwel. OK, for e I can guess the type
Ast.expr, but for pwel it is less obvious. I would therefore
suggest to write

 <:expr< match $e$ with [ $list:pwel$ ] >>: match statement
      (e :: Ast.expr, pwel :: (Ast.patt * Ast.expr option * Ast.expr) list)

BTW, thanks for the additional locations in concrete type
definitions. Tags generation with camlp4 works now very well.

Bye,

Hendrik

@vicuna
Copy link
Author

vicuna commented Jan 28, 2002

Comment author: administrator

Hi,

On Mon, Jan 28, 2002 at 01:47:48PM +0100, tews@tcs.inf.tu-dresden.de wrote:

ithif51 src 41> camlp4o pr_o.cmo gDraw.mli
File "gDraw.mli", line 66, characters 42-43:
Parse error: [type] expected after '[' (in [class_signature])

Ok: this is fixed. It was 2 cases that I had inverted in my code. I fixed
also a non implemented case in the printer.

  • appendix A.11 is about class_sig_item, but the quotation there
    is class_type.

Ok, this is fixed.

  • class_str_item is missing in appendix A.

Indeed. I added it. I saw also that the ast type was indicated as Ast but
it is actually MLast. It is fixed.

Ast.expr, but for pwel it is less obvious. I would therefore
suggest to write

<:expr< match $e$ with [ $list:pwel$ ] >>: match statement
(e :: Ast.expr, pwel :: (Ast.patt * Ast.expr option * Ast.expr) list)

Ok, I am going to think of it. In the meantime, you can also write the
program:
fun e pwel -> <:expr< match $e$ with [ $list:pwel$ ] >>

and see what type is inferred for the two parameters.

--
Daniel de RAUGLAUDRE
daniel.de_rauglaudre@inria.fr
http://cristal.inria.fr/~ddr/

@vicuna
Copy link
Author

vicuna commented Feb 11, 2002

Comment author: administrator

Fixed 2002-01-28 by DdR.

@vicuna vicuna closed this as completed Feb 11, 2002
@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