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

Can't compile lexer example with refill handler from the manual. #7027

Closed
vicuna opened this issue Oct 20, 2015 · 2 comments
Closed

Can't compile lexer example with refill handler from the manual. #7027

vicuna opened this issue Oct 20, 2015 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Oct 20, 2015

Original bug ID: 7027
Reporter: vivien
Status: closed (set by @xavierleroy on 2017-02-16T14:16:42Z)
Resolution: fixed
Priority: normal
Severity: minor
OS: Debian GNU/Linux
OS Version: 8.2
Version: 4.02.3
Fixed in version: 4.03.0+dev / +beta1
Category: tools (ocaml{lex,yacc,dep,debug,...})
Monitored by: @gasche @yallop

Bug description

Ocamllex produces broken code for the example available at http://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html#ss%3Arefill-handlers.

Steps to reproduce

  1. Copy the example from http://caml.inria.fr/pub/docs/manual-ocaml/lexyacc.html#ss%3Arefill-handlers into a 'test.mll' file. [The excerpt starts with {type token = EOL... and ends with {end}.]
  2. Run ocamlbuild test.cmo

Note that ocamllex actually succeeds but ocamlc fails with an error :

File "test.ml", line 152, characters 9-55:
Error: This expression has type token M.t
but an expression was expected of type 'a -> 'b M.t
Command exited with code 2.

Additional information

Same issue with ocaml 4.02.1.

@vicuna
Copy link
Author

vicuna commented Oct 21, 2015

Comment author: @let-def

Fixed here: ocaml/ocaml-manual#14 .

The parameter "arg" is wrong, only the lexbuf argument as to be passed to the continutation.

@vicuna
Copy link
Author

vicuna commented Nov 22, 2015

Comment author: @xavierleroy

Fix commited [0e9d76b]

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