]> git.corax.cc Git - ccc/commitdiff
tokenize: Add parser for '->' tokens and make sure the last token is returned even... tokenizer
authorMatthias Kruk <m@m10k.eu>
Sat, 30 May 2020 15:41:10 +0000 (00:41 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 30 May 2020 15:41:10 +0000 (00:41 +0900)
src/tokenize.c

index a7adf39d4825a8fbc1674821c21e2c483da14a1a..c70f5e3611ba8a5392a7d245144ff394b754f025 100644 (file)
@@ -456,6 +456,9 @@ struct token *nexttoken(void)
                        case '=':
                                return(token_new2(_line, _col, "-="));
 
+                       case '>':
+                               return(token_new2(_line, _col, "->"));
+
                        default:
                                putnext(c);
                                return(token_new2(_line, _col, "-"));
@@ -501,7 +504,7 @@ struct token *nexttoken(void)
                }
        }
 
-       return(NULL);
+       return(tok);
 }
 
 int main(int argc, char *argv[])