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
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")}
IIRC, "Program error:" means that a branch was missing from a case expression. It looks like it's in your parsing library, perhaps in its definition of thenP. If you posted the whole program (if it's not too big) we might be able to help further. --KW 8-)
Keith, Your intuition was exactly right. I was missing a branch in "thenP". It works fine now. Thanks! Dean P.S. Couldn't the message be a bit more helpful? On Mon, 16 Oct 2000, Keith Wansbrough wrote:
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")}
IIRC, "Program error:" means that a branch was missing from a case expression. It looks like it's in your parsing library, perhaps in its definition of thenP. If you posted the whole program (if it's not too big) we might be able to help further.
--KW 8-)
participants (2)
-
Dean Herington -
Keith Wansbrough