caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] ocamlyacc bug?
@ 2003-04-22  6:06 SooHyoung Oh
  2003-04-22 14:28 ` Damien Doligez
  0 siblings, 1 reply; 2+ messages in thread
From: SooHyoung Oh @ 2003-04-22  6:06 UTC (permalink / raw)
  To: Caml-List


Is the following an ocamlyacc bug?

When making application with using ocamlyacc + ocamllex,
you can make main function in trailer part (after second "%%") of "foo.mly"
It that case, it generates an error like this:
    This expression has type Lexing.lexbuf -> Eg_parse.token
    but is here used with type Lexing.lexbuf -> token

It can be fixed by excluding type specification of start non-terminal
function in "foo.ml" like this:
(before)

    let line (lexfun : Lexing.lexbuf -> token) (lexbuf : Lexing.lexbuf) =
       (yyparse yytables 1 lexfun lexbuf : int)

(after)

    let line lexfun (lexbuf : Lexing.lexbuf) =
       (yyparse yytables 1 lexfun lexbuf : int)

If you want, you can view my full source in
http://www.duonix.com/~shoh/ocaml/ocamlyacc.html#bug

---
SooHyoung Oh

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-04-22 14:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-22  6:06 [Caml-list] ocamlyacc bug? SooHyoung Oh
2003-04-22 14:28 ` Damien Doligez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).