fix atom_term

This commit is contained in:
Vitor Santos Costa 2016-12-03 10:32:13 -06:00
parent d37e198c12
commit 44dab9ab33
3 changed files with 9 additions and 15 deletions

View File

@ -264,7 +264,7 @@ bool Yap_ReadlineOps(StreamDesc *s) {
static int prolog_complete(int ignore, int key) {
if (rl_point > 0 && rl_line_buffer[rl_point - 1] != ' ') {
#if HAVE_DECL_RL_CATCH_SIGNALS /* actually version >= 1.2, or true readline \
#if HAVE_DECL_RL_CATCH_SIGNALS /* actually version >= 1.2, or true readline \
*/
rl_begin_undo_group();
rl_complete(ignore, key);

View File

@ -1253,26 +1253,20 @@ static Int style_checker(USES_REGS1) {
}
X_API Term Yap_StringToTerm(const char *s, size_t len, encoding_t *encp,
int prio, Term *bindings) {
int prio, Term *bindingsp) {
CACHE_REGS
Term bvar = MkVarTerm(), ctl;
yhandle_t sl;
Term ctl;
int lvl = push_text_stack();
if (len == 0) {
Term rval = TermEof;
if (rval && bindings) {
*bindings = TermNil;
}
pop_text_stack(lvl);
pop_text_stack(lvl);
return rval;
}
if (bindings) {
ctl = Yap_MkApplTerm(Yap_MkFunctor(AtomVariableNames, 1), 1, &bvar);
sl = Yap_PushHandle(bvar);
if (bindingsp) {
ctl = Yap_MkNewApplTerm(Yap_MkFunctor(AtomVariableNames, 1), 1);
} else {
ctl = TermNil;
sl = 0;
}
Term rval;
@ -1281,8 +1275,8 @@ X_API Term Yap_StringToTerm(const char *s, size_t len, encoding_t *encp,
rval = Yap_read_term(stream, ctl, 3);
Yap_CloseStream(stream);
UNLOCK(GLOBAL_Stream[stream].streamlock);
if (rval && bindings) {
*bindings = Yap_PopHandle(sl);
if (rval && bindingsp) {
*bindingsp = ArgOfTerm(1,ctl);
}
pop_text_stack(lvl);
return rval;

View File

@ -106,7 +106,7 @@ typedef enum mem_buf_source {
extern char *Yap_MemStreamBuf(int sno);
extern X_API Term Yap_StringToTerm(const char *s, size_t len, encoding_t *encp,
int prio, Term *bindings_p);
int prio, Term *bindingsp);
extern Term Yap_StringToNumberTerm(const char *s, encoding_t *encp,
bool error_on);
extern int Yap_FormatFloat(Float f, char **s, size_t sz);