Fixed a problem with interactive mode error handling.
Will need some extra work for Surveyor... tomorrow. git-svn-id: http://picoc.googlecode.com/svn/trunk@215 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
79c7619dab
commit
ccbf149212
6
TODO
6
TODO
|
@ -2,7 +2,13 @@ TODO
|
||||||
|
|
||||||
Bugs:
|
Bugs:
|
||||||
* something wrong with interactive mode after error handling - not clearing token buffer correctly?
|
* something wrong with interactive mode after error handling - not clearing token buffer correctly?
|
||||||
|
|
||||||
|
* interactive mode sometimes bombs out
|
||||||
|
eg. "printf("fred\n", zorch);"
|
||||||
|
|
||||||
* parsing of statements not quite right - seems to optionally want extra tokens at end
|
* parsing of statements not quite right - seems to optionally want extra tokens at end
|
||||||
|
eg. "while (1) {" then end of file
|
||||||
|
eg. "test" then end of file
|
||||||
|
|
||||||
Implement:
|
Implement:
|
||||||
* operator precedence
|
* operator precedence
|
||||||
|
|
1
picoc.h
1
picoc.h
|
@ -334,7 +334,6 @@ int PlatformGetCharacter();
|
||||||
void PlatformPutc(unsigned char OutCh);
|
void PlatformPutc(unsigned char OutCh);
|
||||||
void PlatformPrintf(const char *Format, ...);
|
void PlatformPrintf(const char *Format, ...);
|
||||||
void PlatformVPrintf(const char *Format, va_list Args);
|
void PlatformVPrintf(const char *Format, va_list Args);
|
||||||
int PlatformSetExitPoint();
|
|
||||||
void PlatformExit();
|
void PlatformExit();
|
||||||
void PlatformLibraryInit();
|
void PlatformLibraryInit();
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#define INTERACTIVE_PROMPT_STATEMENT "picoc> "
|
#define INTERACTIVE_PROMPT_STATEMENT "picoc> "
|
||||||
#define INTERACTIVE_PROMPT_LINE " > "
|
#define INTERACTIVE_PROMPT_LINE " > "
|
||||||
|
|
||||||
|
#define PlatformSetExitPoint() setjmp(ExitBuf)
|
||||||
|
|
||||||
/* host platform includes */
|
/* host platform includes */
|
||||||
#ifdef UNIX_HOST
|
#ifdef UNIX_HOST
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
@ -41,6 +43,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
extern jmp_buf ExitBuf;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
# ifdef FLYINGFOX_HOST
|
# ifdef FLYINGFOX_HOST
|
||||||
|
|
||||||
|
|
|
@ -43,12 +43,6 @@ int PlatformGetCharacter()
|
||||||
return getch();
|
return getch();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mark where to end the program for platforms which require this */
|
|
||||||
int PlatformSetExitPoint()
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* exit the program */
|
/* exit the program */
|
||||||
extern int errjmp[];
|
extern int errjmp[];
|
||||||
|
|
||||||
|
|
|
@ -75,11 +75,7 @@ void PlatformScanFile(const char *FileName)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mark where to end the program for platforms which require this */
|
/* mark where to end the program for platforms which require this */
|
||||||
static jmp_buf ExitBuf;
|
jmp_buf ExitBuf;
|
||||||
int PlatformSetExitPoint()
|
|
||||||
{
|
|
||||||
return setjmp(ExitBuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* exit the program */
|
/* exit the program */
|
||||||
void PlatformExit()
|
void PlatformExit()
|
||||||
|
|
Loading…
Reference in a new issue