Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions lib/error.g
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ end);
#
Unbind(ErrorInner);
BIND_GLOBAL("ErrorInner", function(options, earlyMessage)
local context, tracebackContext, mayReturnVoid, mayReturnObj,
local context, tracebackContext, mayReturnVoid,
lateMessage, x, prompt, res, errorLVars, errorTracebackLVars,
kernelErrorLVars, justQuit, printEarlyMessage,
printEarlyTraceback, printAutomaticTraceback, lastErrorStream;
Expand Down Expand Up @@ -262,17 +262,6 @@ BIND_GLOBAL("ErrorInner", function(options, earlyMessage)
mayReturnVoid := false;
fi;

if IsBound(options.mayReturnObj) then
mayReturnObj := options.mayReturnObj;
if not mayReturnObj in [false, true] then
PrintTo(ERROR_OUTPUT, "ErrorInner: option mayReturnObj must be true or false\n");
LEAVE_ALL_NAMESPACES();
JUMP_TO_CATCH(1);
fi;
else
mayReturnObj := false;
fi;

if IsBound(options.tracebackContext) then
tracebackContext := options.tracebackContext;
if not IsLVarsBag(tracebackContext) then
Expand Down Expand Up @@ -410,7 +399,7 @@ BIND_GLOBAL("ErrorInner", function(options, earlyMessage)
prompt := "brk> ";
fi;
if not justQuit then
res := SHELL(context,mayReturnVoid,mayReturnObj,true,prompt,false);
res := SHELL(context,mayReturnVoid,false,true,prompt,false);
else
res := fail;
fi;
Expand Down Expand Up @@ -455,7 +444,6 @@ BIND_GLOBAL("ErrorNoReturn", function(arg)
rec(
context := ParentLVars(GetCurrentLVars()),
mayReturnVoid := false,
mayReturnObj := false,
lateMessage := "type 'quit;' to quit to outer loop",
),
arg);
Expand Down
1 change: 0 additions & 1 deletion lib/methsel2.g
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ end;
context := GetCurrentLVars(),
tracebackContext := ParentLVars(GetCurrentLVars()),
mayReturnVoid := false,
mayReturnObj := false,
lateMessage := "type 'quit;' to quit to outer loop"
),
[ no_method_found ]);
Expand Down
20 changes: 3 additions & 17 deletions src/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ static Obj CallErrorInner(const Char * msg,
Int arg2,
UInt justQuit,
UInt mayReturnVoid,
UInt mayReturnObj,
Obj lateMessage)
{
// Must do this before creating any other GAP objects,
Expand All @@ -447,7 +446,6 @@ static Obj CallErrorInner(const Char * msg,
#endif
AssPRec(r, RNamName("context"), STATE(CurrLVars));
AssPRec(r, RNamName("justQuit"), justQuit ? True : False);
AssPRec(r, RNamName("mayReturnObj"), mayReturnObj ? True : False);
AssPRec(r, RNamName("mayReturnVoid"), mayReturnVoid ? True : False);
AssPRec(r, RNamName("lateMessage"), lateMessage);
l = NewPlistFromArgs(EarlyMsg);
Expand All @@ -469,7 +467,7 @@ static Obj CallErrorInner(const Char * msg,

void ErrorQuit(const Char * msg, Int arg1, Int arg2)
{
CallErrorInner(msg, arg1, arg2, 1, 0, 0, False);
CallErrorInner(msg, arg1, arg2, 1, 0, False);
Panic("ErrorQuit must not return");
}

Expand All @@ -496,18 +494,6 @@ void ErrorMayQuitNrAtLeastArgs(Int narg, Int actual)
}


/****************************************************************************
**
*F ErrorReturnObj( <msg>, <arg1>, <arg2>, <msg2> ) . . print and return obj
*/
Obj ErrorReturnObj(const Char * msg, Int arg1, Int arg2, const Char * msg2)
{
Obj LateMsg;
LateMsg = MakeString(msg2);
return CallErrorInner(msg, arg1, arg2, 0, 0, 1, LateMsg);
}


/****************************************************************************
**
*F ErrorReturnVoid( <msg>, <arg1>, <arg2>, <msg2> ) . . . print and return
Expand All @@ -516,7 +502,7 @@ void ErrorReturnVoid(const Char * msg, Int arg1, Int arg2, const Char * msg2)
{
Obj LateMsg;
LateMsg = MakeString(msg2);
CallErrorInner(msg, arg1, arg2, 0, 1, 0, LateMsg);
CallErrorInner(msg, arg1, arg2, 0, 1, LateMsg);
// ErrorMode( msg, arg1, arg2, (Obj)0, msg2, 'x' );
}

Expand All @@ -527,7 +513,7 @@ void ErrorReturnVoid(const Char * msg, Int arg1, Int arg2, const Char * msg2)
void ErrorMayQuit(const Char * msg, Int arg1, Int arg2)
{
Obj LateMsg = MakeString("type 'quit;' to quit to outer loop");
CallErrorInner(msg, arg1, arg2, 0, 0, 0, LateMsg);
CallErrorInner(msg, arg1, arg2, 0, 0, LateMsg);
Panic("ErrorMayQuit must not return");
}

Expand Down
7 changes: 0 additions & 7 deletions src/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ void ErrorMayQuitNrArgs(Int narg, Int actual) NORETURN;
void ErrorMayQuitNrAtLeastArgs(Int narg, Int actual) NORETURN;


/****************************************************************************
**
*F ErrorReturnObj( <msg>, <arg1>, <arg2>, <msg2> ) . . print and return obj
*/
Obj ErrorReturnObj(const Char * msg, Int arg1, Int arg2, const Char * msg2);


/****************************************************************************
**
*F ErrorReturnVoid( <msg>, <arg1>, <arg2>, <msg2> ) . . . print and return
Expand Down
12 changes: 0 additions & 12 deletions src/stringobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,18 +358,6 @@ EXPORT_INLINE Obj MakeImmStringWithLen(const char * buf, size_t len)
}


/****************************************************************************
**
*F C_NEW_STRING( <string>, <len>, <cstring> ) . . . . . . create GAP string
**
** This macro is deprecated and only provided for backwards compatibility
** with some package kernel extensions. Use 'MakeStringWithLen' and
** 'MakeImmStringWithLen' instead.
*/
#define C_NEW_STRING(string,len,cstr) \
string = MakeStringWithLen( (cstr), (len) )


/****************************************************************************
**
*F AppendCStr( <str>, <buf>, <len> ) . . append data in a buffer to a string
Expand Down
Loading