fix missing syntax errors regression :(

This commit is contained in:
Vítor Santos Costa 2016-02-19 11:34:48 +00:00
parent ad91eb0ec9
commit 083d374e02
2 changed files with 9 additions and 8 deletions

View File

@ -1084,6 +1084,8 @@ Term Yap_Parse(UInt prio) {
#endif #endif
Yap_CloseSlots(sls); Yap_CloseSlots(sls);
if (LOCAL_tokptr != NULL && LOCAL_tokptr->Tok != Ord(eot_tok)) { if (LOCAL_tokptr != NULL && LOCAL_tokptr->Tok != Ord(eot_tok)) {
LOCAL_Error_TYPE = SYNTAX_ERROR;
LOCAL_ErrorMessage = "term does not end on . ";
t = 0; t = 0;
} }
if (t != 0 && LOCAL_Error_TYPE == SYNTAX_ERROR) { if (t != 0 && LOCAL_Error_TYPE == SYNTAX_ERROR) {

View File

@ -867,13 +867,10 @@ static parser_state_t parseError(REnv *re, FEnv *fe, int inp_stream) {
LOCAL_Error_TYPE = SYNTAX_ERROR; LOCAL_Error_TYPE = SYNTAX_ERROR;
Yap_Error(SYNTAX_ERROR, terr, LOCAL_ErrorMessage); Yap_Error(SYNTAX_ERROR, terr, LOCAL_ErrorMessage);
return YAP_PARSING_FINISHED; return YAP_PARSING_FINISHED;
} else { // dec-10
} else if (Yap_PrintWarning(terr)) {
LOCAL_Error_TYPE = YAP_NO_ERROR; LOCAL_Error_TYPE = YAP_NO_ERROR;
if (ParserErrorStyle == TermDec10) {
if (Yap_PrintWarning(terr))
return YAP_SCANNING; return YAP_SCANNING;
return YAP_PARSING_FINISHED;
}
} }
} }
LOCAL_Error_TYPE = YAP_NO_ERROR; LOCAL_Error_TYPE = YAP_NO_ERROR;
@ -893,6 +890,8 @@ static parser_state_t parse(REnv *re, FEnv *fe, int inp_stream) {
#if EMACS #if EMACS
first_char = tokstart->TokPos; first_char = tokstart->TokPos;
#endif /* EMACS */ #endif /* EMACS */
if (LOCAL_Error_TYPE != YAP_NO_ERROR || fe->t == 0)
return YAP_PARSING_ERROR;
return YAP_PARSING_FINISHED; return YAP_PARSING_FINISHED;
} }
@ -902,7 +901,7 @@ static parser_state_t parse(REnv *re, FEnv *fe, int inp_stream) {
* *
* @arg inp_stream: where we read from * @arg inp_stream: where we read from
* @arg: opts, a list with options * @arg: opts, a list with options
* @arg: if called from read_term, arity * @arg: if called from read_term, arity
* called from read_clause, -arity * called from read_clause, -arity
* *
* @return the term or 0 in case of error. * @return the term or 0 in case of error.