diff --git a/hello.c b/hello.c index 0cf55b8..2a80574 100644 --- a/hello.c +++ b/hello.c @@ -3,3 +3,4 @@ int main() printf("Hello world\n"); } +main(); diff --git a/lex.c b/lex.c index 0192c83..a9a63a4 100644 --- a/lex.c +++ b/lex.c @@ -90,17 +90,18 @@ enum LexToken LexGetStringConstant(struct LexState *Lexer) { int Escape = FALSE; - Lexer->Pos++; Lexer->Value.String.Str = Lexer->Pos; - while (Lexer->Pos != Lexer->End && !Escape && *Lexer->Pos != '"') + while (Lexer->Pos != Lexer->End && (*Lexer->Pos != '"' || Escape)) { if (Escape) Escape = FALSE; else if (*Lexer->Pos == '\\') Escape = TRUE; + + Lexer->Pos++; } Lexer->Value.String.Len = Lexer->Pos - Lexer->Value.String.Str; - if (*Lexer->Pos != '"') + if (*Lexer->Pos == '"') Lexer->Pos++; return TokenStringConstant;