X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=lexer.h;h=efbdd6490dc54061969a6a715af1c01b21fedd0f;hp=2573fb209c6077ff8931546845e952053e268367;hb=d6ca5673dc7f2760faca1200477808d919a290ca;hpb=df8b486c98750ee719ddb88a6bb9b90f1e7557d8 diff --git a/lexer.h b/lexer.h index 2573fb2..efbdd64 100644 --- a/lexer.h +++ b/lexer.h @@ -22,7 +22,6 @@ */ #ifndef GMQCC_LEXER_HDR #define GMQCC_LEXER_HDR - typedef struct token_s token; struct token_s { @@ -31,7 +30,7 @@ struct token_s { char *value; union { - vector v; + vec3_t v; int i; double f; int t; /* type */ @@ -42,7 +41,7 @@ struct token_s { struct token_s *prev; #endif - lex_ctx ctx; + lex_ctx_t ctx; }; #if 0 @@ -114,6 +113,7 @@ typedef struct lex_file_s { char *name; size_t line; size_t sline; /* line at the start of a token */ + size_t column; int peek[256]; size_t peekpos; @@ -123,11 +123,11 @@ typedef struct lex_file_s { token tok; /* not a pointer anymore */ struct { - bool noops; - bool nodigraphs; /* used when lexing string constants */ - bool preprocessing; /* whitespace and EOLs become actual tokens */ - bool mergelines; /* backslash at the end of a line escapes the newline */ - } flags; + unsigned noops:1; + unsigned nodigraphs:1; /* used when lexing string constants */ + unsigned preprocessing:1; /* whitespace and EOLs become actual tokens */ + unsigned mergelines:1; /* backslash at the end of a line escapes the newline */ + } flags; /* sizeof == 1 */ int framevalue; frame_macro *frames; @@ -340,6 +340,6 @@ static const size_t qcc_operator_count = (sizeof(qcc_operators) / sizeof(qcc_ope extern const oper_info *operators; extern size_t operator_count; -void lexerror(lex_file*, const char *fmt, ...); +/*void lexerror(lex_file*, const char *fmt, ...);*/ #endif