~groovestomp/c-parser

ccec1b8f50dc783c6568c1d8f338365a202d97c6 — Aaron Oman 2 years ago df73df8
Remove GCC-specific check and fix bugs found by tcc
2 files changed, 11 insertions(+), 10 deletions(-)

M TODO
M src/lexer.c
M TODO => TODO +8 -2
@@ 4,6 4,12 @@
- Unicode support? C unicode libraries: icu, utf8proc, *microutf8*, *nunicode*
  Both microutf8 and nunicode look quite good.

- C Preprocessor
- Support the C preprocessor.

- Remove GNU extensions
- Standard arg parsing.

- Changelog.

- Commit hook for updating changelog as part of release.

- Processing for doing a release.
\ No newline at end of file

M src/lexer.c => src/lexer.c +3 -8
@@ 3,12 3,7 @@

#include "gs.h"

/* GCC-specific defines that let us remove compiler size warnings below. */
#if __LP64__
#define CastSizeIntTo32Bits(x) (int)(x)
#else
#define CastSizeIntTo32Bits(x) (x)
#endif
#define CastSizeIntTo32Bits(x) (u32)(x)

enum token_type {
        Token_Unknown,


@@ 188,7 183,7 @@ void AdvanceTokenizerToChar(struct tokenizer *Tokenizer, char Char) {
        }
}

bool CopyToTokenAndAdvance(struct tokenizer *Tokenizer, struct token *Token, int Length, enum token_type Type) {
void CopyToTokenAndAdvance(struct tokenizer *Tokenizer, struct token *Token, int Length, enum token_type Type) {
        Token->Text = Tokenizer->At;
        Token->TextLength = Length;
        Token->Type = Type;


@@ 579,7 574,7 @@ struct token GetToken(struct tokenizer *Tokenizer) {
        return Token;
}

bool Lex(gs_buffer *FileContents) {
void Lex(gs_buffer *FileContents) {
        struct tokenizer Tokenizer;
        TokenizerInit(&Tokenizer, FileContents->Start);