don't explicitly set EnableDebugger=TRUE when calling PicocParse, state is now set via NO_DEBUGGER compile switch, add ignore items'
This commit is contained in:
parent
f9ffd4e6e8
commit
d6249f4bda
8
.gitignore
vendored
8
.gitignore
vendored
|
@ -8,3 +8,11 @@
|
|||
picoc
|
||||
build/*
|
||||
archives/
|
||||
|
||||
picoc.config
|
||||
picoc.creator
|
||||
picoc.creator.user
|
||||
picoc.files
|
||||
picoc.includes
|
||||
tests/fred.txt
|
||||
|
||||
|
|
14
platform.c
14
platform.c
|
@ -4,6 +4,12 @@
|
|||
#include "picoc.h"
|
||||
#include "interpreter.h"
|
||||
|
||||
#ifdef NO_DEBUGGER
|
||||
static int gEnableDebugger = FALSE;
|
||||
#else
|
||||
static int gEnableDebugger = TRUE;
|
||||
#endif
|
||||
|
||||
|
||||
/* initialise everything */
|
||||
void PicocInitialise(Picoc *pc, int StackSize)
|
||||
|
@ -76,16 +82,16 @@ void PicocCallMain(Picoc *pc, int argc, char **argv)
|
|||
|
||||
if (FuncValue->Val->FuncDef.ReturnType == &pc->VoidType) {
|
||||
if (FuncValue->Val->FuncDef.NumParams == 0)
|
||||
PicocParse(pc, "startup", CALL_MAIN_NO_ARGS_RETURN_VOID, strlen(CALL_MAIN_NO_ARGS_RETURN_VOID), TRUE, TRUE, FALSE, TRUE);
|
||||
PicocParse(pc, "startup", CALL_MAIN_NO_ARGS_RETURN_VOID, strlen(CALL_MAIN_NO_ARGS_RETURN_VOID), TRUE, TRUE, FALSE, gEnableDebugger);
|
||||
else
|
||||
PicocParse(pc, "startup", CALL_MAIN_WITH_ARGS_RETURN_VOID, strlen(CALL_MAIN_WITH_ARGS_RETURN_VOID), TRUE, TRUE, FALSE, TRUE);
|
||||
PicocParse(pc, "startup", CALL_MAIN_WITH_ARGS_RETURN_VOID, strlen(CALL_MAIN_WITH_ARGS_RETURN_VOID), TRUE, TRUE, FALSE, gEnableDebugger);
|
||||
} else {
|
||||
VariableDefinePlatformVar(pc, NULL, "__exit_value", &pc->IntType, (union AnyValue *)&pc->PicocExitValue, TRUE);
|
||||
|
||||
if (FuncValue->Val->FuncDef.NumParams == 0)
|
||||
PicocParse(pc, "startup", CALL_MAIN_NO_ARGS_RETURN_INT, strlen(CALL_MAIN_NO_ARGS_RETURN_INT), TRUE, TRUE, FALSE, TRUE);
|
||||
PicocParse(pc, "startup", CALL_MAIN_NO_ARGS_RETURN_INT, strlen(CALL_MAIN_NO_ARGS_RETURN_INT), TRUE, TRUE, FALSE, gEnableDebugger);
|
||||
else
|
||||
PicocParse(pc, "startup", CALL_MAIN_WITH_ARGS_RETURN_INT, strlen(CALL_MAIN_WITH_ARGS_RETURN_INT), TRUE, TRUE, FALSE, TRUE);
|
||||
PicocParse(pc, "startup", CALL_MAIN_WITH_ARGS_RETURN_INT, strlen(CALL_MAIN_WITH_ARGS_RETURN_INT), TRUE, TRUE, FALSE, gEnableDebugger);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
#include "../picoc.h"
|
||||
#include "../interpreter.h"
|
||||
|
||||
#ifdef NO_DEBUGGER
|
||||
static int gEnableDebugger = FALSE;
|
||||
#else
|
||||
static int gEnableDebugger = TRUE;
|
||||
#endif
|
||||
|
||||
/* mark where to end the program for platforms which require this */
|
||||
jmp_buf PicocExitBuf;
|
||||
|
||||
|
@ -75,7 +81,7 @@ char *PlatformReadFile(Picoc *pc, const char *FileName)
|
|||
void PicocPlatformScanFile(Picoc *pc, const char *FileName)
|
||||
{
|
||||
char *SourceStr = PlatformReadFile(pc, FileName);
|
||||
PicocParse(pc, FileName, SourceStr, strlen(SourceStr), TRUE, FALSE, TRUE, TRUE);
|
||||
PicocParse(pc, FileName, SourceStr, strlen(SourceStr), TRUE, FALSE, TRUE, gEnableDebugger);
|
||||
}
|
||||
|
||||
/* exit the program */
|
||||
|
|
|
@ -6,6 +6,12 @@
|
|||
#include <readline/history.h>
|
||||
#endif
|
||||
|
||||
#ifdef NO_DEBUGGER
|
||||
static int gEnableDebugger = FALSE;
|
||||
#else
|
||||
static int gEnableDebugger = TRUE;
|
||||
#endif
|
||||
|
||||
/* mark where to end the program for platforms which require this */
|
||||
jmp_buf PicocExitBuf;
|
||||
|
||||
|
@ -124,7 +130,7 @@ void PicocPlatformScanFile(Picoc *pc, const char *FileName)
|
|||
SourceStr[1] = '/';
|
||||
}
|
||||
|
||||
PicocParse(pc, FileName, SourceStr, strlen(SourceStr), TRUE, FALSE, TRUE, TRUE);
|
||||
PicocParse(pc, FileName, SourceStr, strlen(SourceStr), TRUE, FALSE, TRUE, gEnableDebugger);
|
||||
}
|
||||
|
||||
/* exit the program */
|
||||
|
|
Loading…
Reference in a new issue