]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - lex.c
Adding a few error message.
[xonotic/gmqcc.git] / lex.c
diff --git a/lex.c b/lex.c
index fa09f27042391d7d7fd8d013331a8e3192f20a34..a7949eaf092c8fa212831055d5b65315df665a9b 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;
 }
 
@@ -318,7 +318,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 +342,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;