Commit df508764 authored by John van Groningen's avatar John van Groningen
Browse files

add ExitEnv_valid

parent 7a682800
...@@ -44,6 +44,7 @@ unsigned CurrentLine; ...@@ -44,6 +44,7 @@ unsigned CurrentLine;
Symbol CurrentSymbol; Symbol CurrentSymbol;
Bool CompilerError; Bool CompilerError;
int ExitEnv_valid=0;
jmp_buf ExitEnv; jmp_buf ExitEnv;
char *OutName = (char *) NIL; char *OutName = (char *) NIL;
...@@ -334,10 +335,10 @@ void FatalCompError (char *mod, char *proc, char *mess) ...@@ -334,10 +335,10 @@ void FatalCompError (char *mod, char *proc, char *mess)
} }
} }
# endif # endif
if (!ExitEnv_valid)
exit (1); exit (1);
#else
longjmp (ExitEnv, 1);
#endif #endif
longjmp (ExitEnv, 1);
} }
void PrintSymbol (Symbol symbol, File file) void PrintSymbol (Symbol symbol, File file)
...@@ -653,6 +654,10 @@ void ExitCompiler (void) ...@@ -653,6 +654,10 @@ void ExitCompiler (void)
OutName = (char *) NIL; OutName = (char *) NIL;
} }
#ifdef CLEAN2
extern struct clean_string_128 { size_t length; char chars[128]; } clean_error_string;
#endif
#ifdef _DEBUG_ #ifdef _DEBUG_
void ErrorInCompiler (char *mod, char *proc, char *msg) void ErrorInCompiler (char *mod, char *proc, char *msg)
...@@ -663,6 +668,12 @@ void ErrorInCompiler (char *mod, char *proc, char *msg) ...@@ -663,6 +668,12 @@ void ErrorInCompiler (char *mod, char *proc, char *msg)
FPrintF (StdError,"Error in compiler: Module %s, Function %s, \"%s\"\n",mod,proc,msg); FPrintF (StdError,"Error in compiler: Module %s, Function %s, \"%s\"\n",mod,proc,msg);
#ifdef CLEAN2 #ifdef CLEAN2
if (CurrentModule!=NULL)
sprintf (clean_error_string.chars,"Error in compiler while compiling %s.icl: Module %s, Function %s, \"%s\"\n",CurrentModule,mod,proc,msg);
else
sprintf (clean_error_string.chars,"Error in compiler: Module %s, Function %s, \"%s\"\n",mod,proc,msg);
clean_error_string.length = strlen (clean_error_string.chars);
# ifdef _MAC_ # ifdef _MAC_
{ {
FILE *f; FILE *f;
...@@ -676,8 +687,10 @@ void ErrorInCompiler (char *mod, char *proc, char *msg) ...@@ -676,8 +687,10 @@ void ErrorInCompiler (char *mod, char *proc, char *msg)
fclose (f); fclose (f);
} }
} }
# endif
exit (1); exit (1);
# endif
if (ExitEnv_valid)
longjmp (ExitEnv, 1);
#endif #endif
} }
......
...@@ -30,6 +30,7 @@ extern char *OutName, *InName; ...@@ -30,6 +30,7 @@ extern char *OutName, *InName;
extern unsigned CurrentLine; extern unsigned CurrentLine;
extern int ExitEnv_valid;
extern File OpenedFile; extern File OpenedFile;
extern jmp_buf ExitEnv; extern jmp_buf ExitEnv;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment