rui314 / 8cc

A Small C Compiler
MIT License
6.13k stars 740 forks source link

Fixed issue with pointer arith. #16

Closed andrewchambers closed 9 years ago

andrewchambers commented 9 years ago

As mentioned in the other PR I closed, This uses a blacklist because the whitelist would need to include < > <= >= && || which take up even more space. Hopefully I didn't miss any operators.

I also learnt how to squash commits which is handy :).

andrewchambers commented 9 years ago

If you don't like the line broken if() I can readd a function as it was. There isn't really a nice way to format it in my opinion. In Go i would have probably done:

switch op {
case '+','*','%','^','&','|':
    error(...)
}

I think the formatting is still going to be a bit ugly in a seperate function.