From 4dff2ad2ecd788cff33ae9549d728ba73b7e3b28 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 31 Mar 2019 11:45:03 +0100 Subject: [PATCH] allow (m:a)/i as indicator. --- C/errors.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/C/errors.c b/C/errors.c index d64e1210c..34b4512c2 100755 --- a/C/errors.c +++ b/C/errors.c @@ -1296,6 +1296,9 @@ static Int is_callable(USES_REGS1) { * + Module:Name//Arity-2 * * if it is, it will extract the predicate's module, name, and arity. + * + * Note: this will now accept both mod:(a/n) and + * (mod:a)/n as valid. */ static Int get_predicate_indicator(USES_REGS1) { Term G = Deref(ARG1); @@ -1317,6 +1320,7 @@ static Int get_predicate_indicator(USES_REGS1) { } if (f == FunctorSlash || f == FunctorDoubleSlash) { Term name = ArgOfTerm(1,G), arity = ArgOfTerm(2,G); + name = Yap_YapStripModule (name, &mod); if (IsVarTerm(name)) { Yap_ThrowError(INSTANTIATION_ERROR, name, NULL); } else if (!IsAtomTerm(name)) {