n0tknowing / chibicc

Personal fork of chibicc (Currently fixing the preprocessor and tokenizer)
MIT License
6 stars 0 forks source link

Parsing `#include <...>` is not right #1

Open n0tknowing opened 1 year ago

n0tknowing commented 1 year ago

Case 1

#include <foo//bar.h>

It's error with message expected '>', but the expected is either the file is opened or error because the file doesn't exist (or whatever the value inside errno as long as it's related to opening a file).

Case 2

#include < stdio.h >

It's success where the expected is failed because both leading and trailing whitespaces is removed. Even if it's success, it should open a file named " stdio.h " not "stdio.h".

Case 3

#include <file with two  spaces.h>

It's expected to open a file named "file with two spaces.h" not "file with two spaces.h"

Why it happened

The fix

n0tknowing commented 1 year ago

If the tokenizer is rewritten, the project will be renamed.

n0tknowing commented 1 year ago

The tokenizer has been rewritten a week ago, and currently working on integrating it with the preprocessor rest of code