scanner fixes

-> vs !
error handling
This commit is contained in:
Vitor Santos Costa
2018-02-21 13:02:20 +00:00
parent 3e71d171e7
commit bdc9e7005d
10 changed files with 141 additions and 35 deletions

View File

@@ -719,21 +719,23 @@ static size_t write_length(const unsigned char *s0, seq_tv_t *out USES_REGS) {
static Term write_number(unsigned char *s, seq_tv_t *out,
bool error_on USES_REGS) {
Term t;
yap_error_number erro = LOCAL_Error_TYPE;
int i = push_text_stack();
yap_error_descriptor_t new_error;
int i = push_text_stack();
Yap_pushErrorContext(&new_error);
t = Yap_StringToNumberTerm((char *)s, &out->enc, error_on);
pop_text_stack(i);
LOCAL_Error_TYPE = erro;
Yap_popErrorContext(true);
return t;
}
static Term string_to_term(void *s, seq_tv_t *out USES_REGS) {
Term o;
yap_error_number erro = LOCAL_Error_TYPE;
o = out->val.t = Yap_BufferToTerm(s, TermNil);
LOCAL_Error_TYPE = erro;
yap_error_descriptor_t new_error;
Yap_pushErrorContext(&new_error);
o = out->val.t = Yap_BufferToTerm(s, TermNil);
Yap_popErrorContext(true);
return o;
return o;
}
bool write_Text(unsigned char *inp, seq_tv_t *out USES_REGS) {