3 ms·
> Zig also takes this approach D took the much more fun way, which is to implement a new C parser from scratch and tweak the D lexer and semantics to handle th
by WalterBright 4y ago
> Zig also takes this approach
D took the much more fun way, which is to implement a new C parser from scratch and tweak the D lexer and semantics to handle the differences of C. It's not too bad, about 5000 lines of D:
https://github.com/dlang/dmd/blob/master/compiler/src/dmd/cparse.d https://github.com/dlang/dmd/blob/master/compiler/src/dmd/cp...