X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=lexer.h;h=75fb83e9320fc159d432819c408b3abf339270c7;hb=f3c5c40104d4757b0b4344a96a4916035a1ba103;hp=4368cf1cf69923d48ffaf33c2c73769cc6b768f6;hpb=29db4a44edb5cce12197ae1e25129d38f70e0225;p=xonotic%2Fgmqcc.git diff --git a/lexer.h b/lexer.h index 4368cf1..75fb83e 100644 --- a/lexer.h +++ b/lexer.h @@ -25,8 +25,6 @@ typedef struct token_s token; -#include "ast.h" - struct token_s { int ttype; @@ -76,6 +74,9 @@ enum { TOKEN_ATTRIBUTE_OPEN, /* [[ */ TOKEN_ATTRIBUTE_CLOSE, /* ]] */ + TOKEN_VA_ARGS, /* for the ftepp only */ + TOKEN_VA_ARGS_ARRAY, /* for the ftepp only */ + TOKEN_STRINGCONST, /* not the typename but an actual "string" */ TOKEN_CHARCONST, TOKEN_VECTORCONST, @@ -99,7 +100,7 @@ typedef struct { int value; } frame_macro; -typedef struct { +typedef struct lex_file_s { FILE *file; const char *open_string; size_t open_string_length; @@ -109,7 +110,7 @@ typedef struct { size_t line; size_t sline; /* line at the start of a token */ - char peek[256]; + int peek[256]; size_t peekpos; bool eof; @@ -250,6 +251,9 @@ static const oper_info fte_operators[] = { { "+", 2, opid1('+'), ASSOC_LEFT, 12, 0 }, { "-", 2, opid1('-'), ASSOC_LEFT, 12, 0 }, + { "<<", 2, opid2('<','<'), ASSOC_LEFT, 11, 0 }, + { ">>", 2, opid2('>','>'), ASSOC_LEFT, 11, 0 }, + { "<", 2, opid1('<'), ASSOC_LEFT, 10, 0 }, { ">", 2, opid1('>'), ASSOC_LEFT, 10, 0 }, { "<=", 2, opid2('<','='), ASSOC_LEFT, 10, 0 },