sysprog21 / shecc

A self-hosting and educational C optimizing compiler
BSD 2-Clause "Simplified" License
1.11k stars 118 forks source link

Migrate preprocessor directive handling #106

Closed ChAoSUnItY closed 8 months ago

ChAoSUnItY commented 8 months ago

This pull request migrates preprocessor directive handling to parser unit, which unify the behaviour of lexer unit by only handling lexical analysis. This also improves preprocessor directive parsing by processing it with token instead of raw string.

Notice that in this pull request, there are several hacks were introduced due to previous faulty design (See lexer.c#lex_accept).

This pull request is part of #84.

jserv commented 8 months ago

Thank @ChAoSUnItY for contributing!