Merge branch 'master' of ssh://git.code.sf.net/p/yap/yap-6.3
This commit is contained in:
commit
bc99b42228
|
@ -36,7 +36,7 @@
|
||||||
url = git://git.code.sf.net/p/yap/pldoc
|
url = git://git.code.sf.net/p/yap/pldoc
|
||||||
[submodule "packages/real"]
|
[submodule "packages/real"]
|
||||||
path = packages/real
|
path = packages/real
|
||||||
url = git://www.swi-prolog.org/home/pl/git/packages/real.git
|
url = git://git.code.sf.net/p/yap/real
|
||||||
[submodule "packages/archive"]
|
[submodule "packages/archive"]
|
||||||
path = packages/archive
|
path = packages/archive
|
||||||
url = git://git.code.sf.net/p/yap/archive
|
url = git://git.code.sf.net/p/yap/archive
|
||||||
|
|
30
C/text.c
30
C/text.c
|
@ -219,8 +219,11 @@ Yap_ListOfAtomsToBuffer(void *buf, Term t, seq_tv_t *inp, int *widep, size_t *le
|
||||||
LOCAL_Error_Term = *r;
|
LOCAL_Error_Term = *r;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (n && !atoms)
|
if (n && !atoms) {
|
||||||
|
LOCAL_Error_Term = t;
|
||||||
|
LOCAL_Error_TYPE = TYPE_ERROR_CHARACTER;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
*lenp = n;
|
*lenp = n;
|
||||||
if (*widep) {
|
if (*widep) {
|
||||||
wchar_t *s;
|
wchar_t *s;
|
||||||
|
@ -351,6 +354,11 @@ read_Text( void *buf, seq_tv_t *inp, encoding_t *enc, int *minimal, size_t *leng
|
||||||
switch (inp->type & YAP_TYPE_MASK) {
|
switch (inp->type & YAP_TYPE_MASK) {
|
||||||
case YAP_STRING_STRING:
|
case YAP_STRING_STRING:
|
||||||
{ const char *s;
|
{ const char *s;
|
||||||
|
if (IsVarTerm(inp->val.t)) {
|
||||||
|
LOCAL_Error_TYPE = INSTANTIATION_ERROR;
|
||||||
|
LOCAL_Error_Term = inp->val.t;
|
||||||
|
return 0L;
|
||||||
|
}
|
||||||
if (!IsStringTerm(inp->val.t)) {
|
if (!IsStringTerm(inp->val.t)) {
|
||||||
LOCAL_Error_TYPE = TYPE_ERROR_STRING;
|
LOCAL_Error_TYPE = TYPE_ERROR_STRING;
|
||||||
LOCAL_Error_Term = inp->val.t;
|
LOCAL_Error_Term = inp->val.t;
|
||||||
|
@ -399,7 +407,11 @@ read_Text( void *buf, seq_tv_t *inp, encoding_t *enc, int *minimal, size_t *leng
|
||||||
case YAP_STRING_ATOM:
|
case YAP_STRING_ATOM:
|
||||||
// this is a term, extract to a buffer, and representation is wide
|
// this is a term, extract to a buffer, and representation is wide
|
||||||
*minimal = TRUE;
|
*minimal = TRUE;
|
||||||
if (!IsAtomTerm(inp->val.t)) {
|
if (IsVarTerm(inp->val.t)) {
|
||||||
|
LOCAL_Error_TYPE = INSTANTIATION_ERROR;
|
||||||
|
LOCAL_Error_Term = inp->val.t;
|
||||||
|
return 0L;
|
||||||
|
} else if (!IsAtomTerm(inp->val.t)) {
|
||||||
LOCAL_Error_TYPE = TYPE_ERROR_ATOM;
|
LOCAL_Error_TYPE = TYPE_ERROR_ATOM;
|
||||||
LOCAL_Error_Term = inp->val.t;
|
LOCAL_Error_Term = inp->val.t;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -490,7 +502,11 @@ read_Text( void *buf, seq_tv_t *inp, encoding_t *enc, int *minimal, size_t *leng
|
||||||
return NULL;
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
Term t = inp->val.t;
|
Term t = inp->val.t;
|
||||||
if (IsStringTerm(t)) {
|
if (IsVarTerm(t)) {
|
||||||
|
LOCAL_Error_TYPE = INSTANTIATION_ERROR;
|
||||||
|
LOCAL_Error_Term = t;
|
||||||
|
return NULL;
|
||||||
|
} else if (IsStringTerm(t)) {
|
||||||
if (inp->type & (YAP_STRING_STRING)) {
|
if (inp->type & (YAP_STRING_STRING)) {
|
||||||
inp->type &= (YAP_STRING_STRING);
|
inp->type &= (YAP_STRING_STRING);
|
||||||
return read_Text( buf, inp, enc, minimal, lengp PASS_REGS);
|
return read_Text( buf, inp, enc, minimal, lengp PASS_REGS);
|
||||||
|
@ -507,14 +523,14 @@ read_Text( void *buf, seq_tv_t *inp, encoding_t *enc, int *minimal, size_t *leng
|
||||||
LOCAL_Error_Term = t;
|
LOCAL_Error_Term = t;
|
||||||
}
|
}
|
||||||
} else if (IsAtomTerm(t)) {
|
} else if (IsAtomTerm(t)) {
|
||||||
if (inp->type & (YAP_STRING_ATOM)) {
|
if (t == TermNil && inp->type & (YAP_STRING_CODES|YAP_STRING_ATOMS)) {
|
||||||
|
inp->type &= (YAP_STRING_CODES|YAP_STRING_ATOMS);
|
||||||
|
return read_Text( buf, inp, enc, minimal, lengp PASS_REGS);
|
||||||
|
} else if (inp->type & (YAP_STRING_ATOM)) {
|
||||||
inp->type &= (YAP_STRING_ATOM);
|
inp->type &= (YAP_STRING_ATOM);
|
||||||
inp->val.t = t;
|
inp->val.t = t;
|
||||||
return read_Text( buf, inp, enc, minimal, lengp PASS_REGS);
|
return read_Text( buf, inp, enc, minimal, lengp PASS_REGS);
|
||||||
// [] is special...
|
// [] is special...
|
||||||
} else if (t == TermNil && inp->type & (YAP_STRING_CODES|YAP_STRING_ATOMS)) {
|
|
||||||
inp->type &= (YAP_STRING_CODES|YAP_STRING_ATOMS);
|
|
||||||
return read_Text( buf, inp, enc, minimal, lengp PASS_REGS);
|
|
||||||
} else {
|
} else {
|
||||||
LOCAL_Error_TYPE = gen_type_error( inp->type );
|
LOCAL_Error_TYPE = gen_type_error( inp->type );
|
||||||
LOCAL_Error_Term = t;
|
LOCAL_Error_Term = t;
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5a72fe49e5a5c651a890a388eb967b83da8e2c52
|
Subproject commit a383bfd51144172fdea8463bd56e9308742e5de2
|
Reference in New Issue