aboutsummaryrefslogtreecommitdiffhomepage
path: root/c/lex.c
Commit message (Collapse)AuthorAgeFilesLines
* c: support CRLF newlines lemon2025-12-201-3/+11
|
* lexer: fix remnant use of TKEOF for character lemon2025-12-201-9/+7
|
* optimize lexer a bit more lemon2025-12-201-60/+86
|
* lexer: convert pp-idents to keywords only after preprocessing lemon2025-12-201-63/+65
|
* cpp: GNU extension for named variadic arguments lemon2025-12-181-4/+7
|
* cpp: better error recovery for #define syntax error lemon2025-12-181-6/+7
|
* nicer defaults and facilities for cross-compilation lemon2025-12-171-2/+16
|
* create distinct interned string type lemon2025-12-151-22/+21
| | | | | | | | | | | | | | 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-45/+0
| | | | | Being in lex.c was vestigial, since it was being used all over the frontend and backend.
* lex: loop with goto instead of tail recursion lemon2025-12-151-7/+8
| | | | | This uncovered a edgecase with loops and lifetime construction in regalloc!
* lexer: use a hashmap to lookup keywords lemon2025-12-151-27/+27
|
* cpp: support #line directives lemon2025-12-141-10/+75
|
* cpp: correctly handle extra tokens after directives lemon2025-12-141-16/+21
|
* s/amd64/x86_64/ lemon2025-12-121-1/+1
|
* lex: use pmap for macro lookup lemon2025-12-121-125/+69
| | | | To reduce hashmap code repetition. Also add pmap_del for this purpose
* rename arraylength macro -> countof lemon2025-12-111-20/+20
|
* -trigraphs option lemon2025-12-111-3/+3
|
* lex/expr(): cleanup lemon2025-12-111-29/+29
|
* lexer: properly add padding for cpppredefs lemon2025-12-101-2/+2
|
* lex: make some hashtables resizable lemon2025-12-091-29/+67
| | | | Was hiting the fixed limits trying to preprocess sqlite3amalgamation
* add command-line predefined macros (-D, -U) lemon2025-12-061-4/+52
|
* cpp: implement preprocessor expressions short circuiting behaviour lemon2025-12-031-17/+23
| | | | This only affects whether an error is given for something like `0 && 0/0` (it shouldn't)
* preprocessor: add #ifndef...#endif include guard optimization lemon2025-12-021-11/+27
|
* lex: remove some hacks and optimize preprocessor lemon2025-11-281-39/+34
|
* pp: fix token pasting (hopefully) lemon2025-11-241-27/+15
|
* lex: TEMP hack: #define __x86_64__ or some system headers break subtly lemon2025-11-231-0/+1
|
* cpp: fix bugs with recursive macro expansion (hopefully) lemon2025-11-231-28/+24
|
* cpp: fix ## bug lemon2025-11-231-1/+1
|
* c: move warning for extension keyword til after preprocessor lemon2025-11-221-2/+2
|
* lex: #include ".." should also look in working directory lemon2025-11-221-19/+17
|
* lex: move token data from tmp to glob arena when used in a macro body lemon2025-11-221-2/+7
| | | | | | maybe introduce per-macro arenas to tie their lifetimes to that. but most macros have global lifetime (i.e. aren't #undef'd) so there probably wouldn't be much benefit to that
* cpp: add predefined __antcc__ macro, for debugging lemon2025-11-201-0/+1
|
* ir: 'trap' jump; c: __builtin_trap; lex: __has_builtin lemon2025-11-151-4/+25
|
* lex: fix single-line comment eating up preprocessor directive in next line lemon2025-11-081-1/+1
|
* lex: #warning and #error lemon2025-11-081-2/+13
|
* lex: fix bugs filling char buffer lemon2025-10-271-14/+22
|
* lex enlarge internht lemon2025-10-231-1/+1
|
* lex: fix expansion for fn like macros passed as macro arguments lemon2025-10-231-1/+1
|
* lex: fix consecutive preprocessor concatenation lemon2025-10-231-7/+10
|
* use libc's stdout/stderr; also eliminate some unnecessary recursion in bfmt lemon2025-10-231-1/+1
|
* lex: fix base-16 literals adding an extra zero when there's a type suffix lemon2025-10-231-4/+3
|
* lex: handle all the whitespace characters lemon2025-10-211-1/+1
|
* refactor vec_of(T) and misc lemon2025-10-201-7/+14
|
* Organize source files into directories lemon2025-10-191-0/+1977