<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">For want of any reason other than it’s easy I have decided to raise an exception during my ast parsing, I don’t know how deep down or where I may be when trouble is detected and so it seems like the quickest way out; for my application I don’t need to attempt a restart, it’s game over at that point.<div class=""><br class=""></div><div class="">Here is my simple try block</div><div class=""><br class=""></div><div class=""><font face="Courier New" class="">on_lexer(Lx, AST) :-<br class="">    AST = astcon,<br class="">    list.filter_map(promote, lexer.tokens(Lx), ATokens),<br class="">    atrace("after promotion: %s\n\n--", [s(string(ATokens))]),<br class="">    (<br class="">        try []<br class="">            ast([], Tree, ATokens, Rest)<br class="">        then<br class="">            atrace("then block, Rest: %s\n", [s(string(Rest))])<br class="">        else<br class="">            atrace("else block\n", [])<br class="">        catch syntax_error(Pos, Why) -><br class="">            atrace("oops: %s at %s", [s(Why), s(string(Pos))])<br class="">    ).</font></div><div class=""><br class=""></div><div class="">and the compiler error seems to be in the C code not the mercury code,</div><div class=""><br class=""></div><div class=""><font face="Courier New" class="">mmc -s hlc.gc -O4 -E -ledit --make felt<br class="">Making Mercury/int3s/ast.int3<br class="">Making Mercury/ints/ast.int<br class="">Making Mercury/cs/ast.c<br class="">Uncaught Mercury exception:<br class="">Software Error: predicate `check_hlds.try_expand.extract_intermediate_goal_parts'/7: Unexpected: unexpected goal form<br class="">** Error making `Mercury/cs/ast.c'.<br class="">make: *** [felt] Error 1<br class="">The terminal process "/bin/zsh '-c', 'make -f Makefile'" terminated with exit code: 2.</font></div><div class=""><br class=""></div><div class="">And I have no idea what I did to upset it now how to proceed. I searched for ‘try []’ in the source distribution to get some examples and then went for it.</div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Sean</div><div class=""><br class=""></div></body></html>