mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Cleaned up lexer
- separated the lexer into multiple functions so it is more readable - fixed issue with long label names in macro arguments - added error checking code to prevent buffer overflows
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
|
||||
#include "asm/types.h"
|
||||
|
||||
#define LEXHASHSIZE 512
|
||||
#define LEXHASHSIZE (1 << 11)
|
||||
#define MAXSTRLEN 255
|
||||
|
||||
struct sLexInitString {
|
||||
char *tzName;
|
||||
@@ -18,7 +19,9 @@ struct sLexFloat {
|
||||
};
|
||||
|
||||
struct yy_buffer_state {
|
||||
char *pBufferStart;
|
||||
char *pBufferRealStart; // actual starting address
|
||||
char *pBufferStart; // address where the data is initially written
|
||||
// after the "safety margin"
|
||||
char *pBuffer;
|
||||
ULONG nBufferSize;
|
||||
ULONG oAtLineStart;
|
||||
|
||||
Reference in New Issue
Block a user