]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lexer.h
Use the _t consistency naming scheme. Also various cleanups.
[xonotic/gmqcc.git] / lexer.h
diff --git a/lexer.h b/lexer.h
index b73fa5f1dbdcbc2c2850006edc57bf6224203667..efbdd6490dc54061969a6a715af1c01b21fedd0f 100644 (file)
--- a/lexer.h
+++ b/lexer.h
@@ -30,7 +30,7 @@ struct token_s {
     char *value;
 
     union {
-        vector v;
+        vec3_t v;
         int    i;
         double f;
         int    t; /* type */
@@ -41,7 +41,7 @@ struct token_s {
     struct token_s *prev;
 #endif
 
-    lex_ctx *ctx;
+    lex_ctx_t ctx;
 };
 
 #if 0
@@ -110,15 +110,10 @@ typedef struct lex_file_s {
     size_t      open_string_length;
     size_t      open_string_pos;
 
+    char   *name;
+    size_t  line;
     size_t  sline; /* line at the start of a token */
-
-    /* 
-     * no more 'shallow' copies, instead all new instances
-     * of a lex_ctx will just point to this lex_file::ctx.
-     * i.e 4/8 byte pointer. Instead of every token getting
-     * a 'shallow' 12/24 byte structure.
-     */
-    lex_ctx ctx;
+    size_t  column;
 
     int     peek[256];
     size_t  peekpos;
@@ -128,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;