#Production ready regular expressions in zig?
1 messages · Page 1 of 1 (latest)
No you don't
?
Regex is a very bad way to make a lexer
Yeah why not?
okay
You can use regex for your lexer but I'd suggest you use a while loop and a switch statement. Here's an example: https://github.com/tusharsadhwani/zlox/blob/main/src/tokenizer.zig#L103-L148
Handles floats, strings, variables, 1 and 2 character operators.
use re2c
for lexer
there's a fork that generates zig code
I used it and it works
can you link to that
yeah can u link that
Its short and sweet. Nice
@stuck ocean https://github.com/Techcable/re2c-zig
Hey thanks
thanks