Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Catching a double semicolon
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Allsopp <dra-news@m...>
Subject: Re: [Caml-list] Catching a double semicolon
> I wish there was a way to get debugging output when a  
> Parsing.Parser_error exception is triggered as I can't figure out  
> what rule the parser is chocking on when I try an expression with two  
> semicolons at the end.

Set the CAMLRUNPARAM environment variable to "p" and you will get debugging
output of the automata including error recovery attempts that lead to
Parse_error exceptions (see 10.2 in the manual). Be careful when you set it
though: it debugs *all* automata generated with ocamlyacc so remember to
unset it when running ocamlc or compilation will take some time! While it's
a pretty primitive debugging aid, in combination with ocamlyacc -v I find it
sufficient to diagnose most grammar errors...


David