Increment the number of tokens found after the array storage.
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 9 Nov 2017 13:51:10 +0000 (14:51 +0100)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 9 Nov 2017 13:51:10 +0000 (14:51 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
lexer/main.c

index db41495086b75c03aa4a24683d07a188dabbc429..19fc34f8763db78ec958d8d31b7d4e656090b0c8 100644 (file)
@@ -268,8 +268,8 @@ int main (int argc, char const *argv[]) {
         } else {
             printf ("Token type found: %s\n", tokenTypestr[tokenType]);
         }
-        tokenFound++;
         tokenList[tokenFound] = tokenTypestr[tokenType];
+        tokenFound++;
         // reinit tokenValue
         i = 0;
         memset(tokenValue, 0, sizeof(tokenValue));