]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lex.c
Testing CALLs in test-ast
[xonotic/gmqcc.git] / lex.c
diff --git a/lex.c b/lex.c
index fa09f27042391d7d7fd8d013331a8e3192f20a34..54875a35a1314d1459157236a9cb5d416e481410 100644 (file)
--- a/lex.c
+++ b/lex.c
@@ -67,7 +67,7 @@ static void lex_addch(int ch, lex_file *file) {
     if (file->current == sizeof(file->lastok)-1)
         file->lastok[file->current]   = (char)'\0';
 }
-static inline void lex_clear(lex_file *file) {
+static GMQCC_INLINE void lex_clear(lex_file *file) {
     file->current = 0;
 }
 
@@ -124,7 +124,6 @@ static int lex_trigraph(lex_file *file) {
         default:
             lex_unget('?', file);
             lex_unget(ch , file);
-            return '?';
     }
     return '?';
 }
@@ -318,7 +317,7 @@ int lex_token(lex_file *file) {
         #undef TEST_TYPE
         return LEX_IDENT;
     }
-    return ch;
+    return (ch != ' ') ? ch : lex_token(file);
 }
 
 void lex_reset(lex_file *file) {
@@ -342,13 +341,13 @@ void lex_parse(lex_file *file) {
  * recrusion.
  */
 lex_file *lex_include(lex_file *lex, const char *file) {
+    lex_file *set = NULL;
+
     util_strrq(file);
     if (strncmp(lex->name, file, strlen(lex->name)) == 0) {
         error(lex, ERROR_LEX, "Source file cannot include itself\n");
         exit (-1);
     }
-
-    lex_file *set = NULL;
     lex_init(file, &set);
 
     return set;