fix bug in sb_atom
This commit is contained in:
parent
0be43c6525
commit
da65d7bd3c
22
C/atomic.c
22
C/atomic.c
@ -1880,7 +1880,6 @@ static Int cont_sub_atomic(USES_REGS1) {
|
|||||||
size_t minv, len, after, sz;
|
size_t minv, len, after, sz;
|
||||||
wchar_t *wp = NULL;
|
wchar_t *wp = NULL;
|
||||||
const unsigned char *p = NULL, *p5 = NULL;
|
const unsigned char *p = NULL, *p5 = NULL;
|
||||||
bool sub_atom = TRUE;
|
|
||||||
|
|
||||||
mask = IntegerOfTerm(EXTRA_CBACK_ARG(5, 1));
|
mask = IntegerOfTerm(EXTRA_CBACK_ARG(5, 1));
|
||||||
minv = IntegerOfTerm(EXTRA_CBACK_ARG(5, 2));
|
minv = IntegerOfTerm(EXTRA_CBACK_ARG(5, 2));
|
||||||
@ -1987,7 +1986,6 @@ static Int cont_sub_atomic(USES_REGS1) {
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static Int sub_atomic(bool sub_atom, bool sub_string USES_REGS) {
|
static Int sub_atomic(bool sub_atom, bool sub_string USES_REGS) {
|
||||||
Term tat1, tbef, tsize, tafter, tout;
|
Term tat1, tbef, tsize, tafter, tout;
|
||||||
int mask = SUB_ATOM_HAS_UTF8;
|
int mask = SUB_ATOM_HAS_UTF8;
|
||||||
@ -2196,9 +2194,7 @@ static Int cont_sub_atomic(USES_REGS1) {
|
|||||||
sub-strings of _A_.
|
sub-strings of _A_.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
static Int sub_atom(USES_REGS1) {
|
static Int sub_atom(USES_REGS1) { return (sub_atomic(true, false PASS_REGS)); }
|
||||||
return (sub_atomic(true, false PASS_REGS));
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @pred sub_string(+ _S_,? _Bef_, ? _Size_, ? _After_, ? _S_out_) is
|
/** @pred sub_string(+ _S_,? _Bef_, ? _Size_, ? _After_, ? _S_out_) is
|
||||||
iso
|
iso
|
||||||
@ -2215,9 +2211,7 @@ static Int cont_sub_atomic(USES_REGS1) {
|
|||||||
sub-strings of _S_.
|
sub-strings of _S_.
|
||||||
|
|
||||||
*/
|
*/
|
||||||
static Int sub_string(USES_REGS1) {
|
static Int sub_string(USES_REGS1) { return sub_atomic(false, true PASS_REGS); }
|
||||||
return sub_atomic(false, true PASS_REGS);
|
|
||||||
}
|
|
||||||
|
|
||||||
static Int cont_current_atom(USES_REGS1) {
|
static Int cont_current_atom(USES_REGS1) {
|
||||||
Atom catom;
|
Atom catom;
|
||||||
@ -2299,16 +2293,14 @@ static Int cont_sub_atomic(USES_REGS1) {
|
|||||||
void Yap_InitBackAtoms(void) {
|
void Yap_InitBackAtoms(void) {
|
||||||
Yap_InitCPredBack("$current_atom", 1, 2, current_atom, cont_current_atom,
|
Yap_InitCPredBack("$current_atom", 1, 2, current_atom, cont_current_atom,
|
||||||
SafePredFlag | SyncPredFlag);
|
SafePredFlag | SyncPredFlag);
|
||||||
Yap_InitCPredBack("atom_concat", 3, 2, atom_concat3, cont_atom_concat3,
|
Yap_InitCPredBack("atom_concat", 3, 2, atom_concat3, cont_atom_concat3, 0);
|
||||||
|
Yap_InitCPredBack("atomic_concat", 3, 2, atomic_concat3, cont_atomic_concat3,
|
||||||
|
0);
|
||||||
|
Yap_InitCPredBack("string_concat", 3, 2, string_concat3, cont_string_concat3,
|
||||||
0);
|
0);
|
||||||
Yap_InitCPredBack("atomic_concat", 3, 2, atomic_concat3,
|
|
||||||
cont_atomic_concat3, 0);
|
|
||||||
Yap_InitCPredBack("string_concat", 3, 2, string_concat3,
|
|
||||||
cont_string_concat3, 0);
|
|
||||||
Yap_InitCPredBack("sub_atom", 5, 5, sub_atom, cont_sub_atomic, 0);
|
Yap_InitCPredBack("sub_atom", 5, 5, sub_atom, cont_sub_atomic, 0);
|
||||||
Yap_InitCPredBack("sub_string", 5, 5, sub_string, cont_sub_atomic, 0);
|
Yap_InitCPredBack("sub_string", 5, 5, sub_string, cont_sub_atomic, 0);
|
||||||
Yap_InitCPredBack("string_code", 3, 1, string_code3, cont_string_code3,
|
Yap_InitCPredBack("string_code", 3, 1, string_code3, cont_string_code3, 0);
|
||||||
0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Yap_InitAtomPreds(void) {
|
void Yap_InitAtomPreds(void) {
|
||||||
|
Reference in New Issue
Block a user