aboutsummaryrefslogtreecommitdiffhomepage
path: root/c/lex.h
Commit message (Collapse)AuthorAgeFilesLines
* lexer: convert pp-idents to keywords only after preprocessinglemon2025-12-201-8/+10
|
* create distinct interned string typelemon2025-12-151-1/+2
| | | | | | | | | | | | | | Interned strings are used pervasively, so it's a good idea to add a layer of type safety to differentiate them from general cstrs and avoid potential bugs from comparing non-interned and interned strings. Not that that's happened so far that I can remember, but it could. I'm 90% sure it's legal to alias `struct {char c;}` pointers with `char` pointers. This specific typedef gives type safety but with a simple one-way `internstr -> const char *` typecast (with `&istr->c`). Converting the other way around is more intentional: a straight up cast `(internstr)cstr` which sticks out as unchecked and probably wrong, or calling the intern(cstr) function, which is the right way.
* move intern() to mem.clemon2025-12-151-1/+0
| | | | | Being in lex.c was vestigial, since it was being used all over the frontend and backend.
* lex: use pmap for macro lookuplemon2025-12-121-1/+1
| | | | To reduce hashmap code repetition. Also add pmap_del for this purpose
* preprocessor: add #ifndef...#endif include guard optimizationlemon2025-12-021-0/+3
|
* cpp: fix bugs with recursive macro expansion (hopefully)lemon2025-11-231-0/+1
|
* c: move warning for extension keyword til after preprocessorlemon2025-11-221-0/+1
|
* factor type stuff into type.hlemon2025-11-161-0/+1
|
* lex: fix bugs filling char bufferlemon2025-10-271-1/+1
|
* refactor vec_of(T) and misclemon2025-10-201-0/+1
|
* Organize source files into directorieslemon2025-10-191-0/+115