unexpected "Program error:"

Dean Herington heringto@cs.unc.edu
Sun, 15 Oct 2000 21:36:17 -0400 (EDT)


I'm getting an unexpected "Program error:" in a situation where I don't
think "error" is being called.  Moreover, the error message is bizarre,
though I can see in the gobbledy-gook the structure of the piece of my
program where things are going awry.  The exact message (except for
addition of some line breaks) is:

Program error: {thenP_v1700 parser_v1798 ((initialSymbols [] (Num_fromInt
 instNum_v33 0),Num_fromInt instNum_v33 0),ParseResult_Failed
 (Posn_Pn_v1551 (Num_fromInt instNum_v33 0) (Num_fromInt instNum_v33 0)
 (Num_fromInt instNum_v33 0)) "Parse error")}

Under what circumstances should I see such a strange "Program error:"
message?

In case it helps, here's the piece of my program that seems to match the
message above:

>   case runP (parser (tokens input)) (initialSymbols [] 0, 0) of
>     Ok (ast, st) -> do hPrint hOut ast
>                        hPutStrLn hOut ""
>                        hPrint hOut st
>     Failed pos msg -> hPrint hOut (parseMsg pos msg)

The program works when, in the above snippet, the "Ok" case obtains.  It
fails in the "Failed" case.

Of course, I could send the entire program if that would be useful.

I'm running the February 2000 version of Hugs on Solaris.

Thanks.

Dean Herington
heringto@cs.unc.edu