aboutsummaryrefslogtreecommitdiffhomepage
path: root/c/lex.h
Commit message (Collapse)AuthorAgeFilesLines
* c: keyword aliases lemon2025-12-211-1/+1
| | | | | Some linux headers use __signed__ for whatever reason.. this is a general fix for those alternate keyword
* lexer: note source of #include when error occurs in #included file lemon2025-12-201-1/+2
|
* optimize lexer a bit more lemon2025-12-201-2/+2
|
* lexer: convert pp-idents to keywords only after preprocessing lemon2025-12-201-8/+10
|
* create distinct interned string type lemon2025-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.c lemon2025-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 lookup lemon2025-12-121-1/+1
| | | | To reduce hashmap code repetition. Also add pmap_del for this purpose
* preprocessor: add #ifndef...#endif include guard optimization lemon2025-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 preprocessor lemon2025-11-221-0/+1
|
* factor type stuff into type.h lemon2025-11-161-0/+1
|
* lex: fix bugs filling char buffer lemon2025-10-271-1/+1
|
* refactor vec_of(T) and misc lemon2025-10-201-0/+1
|
* Organize source files into directories lemon2025-10-191-0/+115