fixes to modules.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@988 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
97c809d955
commit
8e18b8cdf7
@ -2870,7 +2870,7 @@ Yap_InitComma(void)
|
||||
code_p->u.sla.s = emit_count(-Signed(RealEnvSize) - sizeof(CELL) * 3);
|
||||
code_p->u.sla.sla_u.p =
|
||||
code_p->u.sla.p0 =
|
||||
RepPredProp(PredPropByFunc(FunctorComma,2));
|
||||
RepPredProp(PredPropByFunc(FunctorComma,0));
|
||||
code_p->u.sla.bmap = NULL;
|
||||
GONEXT(sla);
|
||||
if (PRED_GOAL_EXPANSION_ON) {
|
||||
|
2
C/init.c
2
C/init.c
@ -713,6 +713,7 @@ InitCodes(void)
|
||||
Functor
|
||||
FunctorThrow;
|
||||
|
||||
heap_regs->term_prolog = MkAtomTerm(Yap_LookupAtom("prolog"));
|
||||
heap_regs->user_module = MkAtomTerm(Yap_LookupAtom("user"));
|
||||
heap_regs->idb_module = MkAtomTerm(Yap_LookupAtom("idb"));
|
||||
heap_regs->attributes_module = MkAtomTerm(Yap_LookupAtom("attributes"));
|
||||
@ -991,7 +992,6 @@ InitCodes(void)
|
||||
#ifdef EUROTRA
|
||||
heap_regs->term_dollar_u = MkAtomTerm(Yap_FullLookupAtom("$u"));
|
||||
#endif
|
||||
heap_regs->term_prolog = MkAtomTerm(Yap_LookupAtom("prolog"));
|
||||
heap_regs->term_refound_var = MkAtomTerm(Yap_FullLookupAtom("$I_FOUND_THE_VARIABLE_AGAIN"));
|
||||
heap_regs->dyn_array_list = NULL;
|
||||
heap_regs->n_of_file_aliases = 0;
|
||||
|
13
C/modules.c
13
C/modules.c
@ -51,6 +51,9 @@ LookupModule(Term a)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
/* prolog module */
|
||||
if (a == 0)
|
||||
return 0;
|
||||
for (i = 0; i < NoOfModules; ++i) {
|
||||
if (ModuleName[i] == a) {
|
||||
return i;
|
||||
@ -121,13 +124,13 @@ p_change_module(void)
|
||||
static Int
|
||||
cont_current_module(void)
|
||||
{
|
||||
Int mod = IntOfTerm(EXTRA_CBACK_ARG(1,1));
|
||||
Term t = ModuleName[mod];
|
||||
Int imod = IntOfTerm(EXTRA_CBACK_ARG(1,1));
|
||||
Term t = ModuleName[imod];
|
||||
|
||||
if (mod == NoOfModules) {
|
||||
if (imod == NoOfModules) {
|
||||
cut_fail();
|
||||
}
|
||||
EXTRA_CBACK_ARG(1,1) = MkIntTerm(mod+1);
|
||||
EXTRA_CBACK_ARG(1,1) = MkIntTerm(imod+1);
|
||||
return(Yap_unify(ARG1,t));
|
||||
}
|
||||
|
||||
@ -152,7 +155,7 @@ Yap_InitModulesC(void)
|
||||
void
|
||||
Yap_InitModules(void)
|
||||
{
|
||||
ModuleName[0] =
|
||||
ModuleName[PROLOG_MODULE] =
|
||||
TermProlog;
|
||||
ModuleName[1] =
|
||||
USER_MODULE;
|
||||
|
Reference in New Issue
Block a user