X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=lexer%2Fmain.c;h=8122023c63a6a6ded748ea99eda9cfba89d1e840;hb=a2ddf6fa81ecebe495d16e59af7575d384bfaf37;hp=a53d793e827c26326f216db73dfe3e48e71328f5;hpb=532c982ba87cc996478efede25f6eb62a5c97e48;p=TP_AL_C.git diff --git a/lexer/main.c b/lexer/main.c index a53d793..8122023 100644 --- a/lexer/main.c +++ b/lexer/main.c @@ -17,7 +17,7 @@ enum TokenType { } tokenType; const char* tokenTypestr[] = { "MOTCLE", "SECTION", "SSECTION", "NPARA", "MOT", "FIN" }; -/* This looks silly to check for each characters but for debugging, it's just the way to go */ +/* It looks silly to check for each characters but for debugging, it's just the way to go */ bool istAlpha() { if (c == 'a' || c == 'b' || c == 'c' || c == 'd' || c == 'e' || c == 'f' || c == 'g' || \ c == 'h' || c == 'i' || c == 'j' || c == 'k' || c == 'l' || c == 'm' || c == 'n' || \ @@ -44,9 +44,9 @@ bool isSeparator() { } int scanner() { -const char* Titre = "Titre"; -const char* Auteur = "Auteur"; -unsigned int j = 0; + const char* Titre = "Titre"; + const char* Auteur = "Auteur"; + unsigned int j = 0; // The main loop get the next character init: @@ -87,6 +87,7 @@ init: } MC1: + // FIXME: Partial match need a rewind in the characters extraction from the file if (c == Titre[j] && j < strlen(Titre) - 1) { c = fgetc(source); tokenValue[i] = c;