3 ms·
The first non-boilerplate-header line in b.c: /* lasciate ogne speranza, voi ch'intrate. */ Well, that's encouraging... ("Abandon all hope, you who enter
by throwanem 10y ago
The first non-boilerplate-header line in b.c:
/* lasciate ogne speranza, voi ch'intrate. */
Well, that's encouraging...
("Abandon all hope, you who enter here.")
- chubot 10y agoAdmittedly I haven't stepped through all the code, but it's 958 lines and doesn't look horrible. It somewhat resembles the example C programs here: https://swtch.com/~rsc/regexp/ https://swtch.com/~rsc/regexp/ In particular there don't seem to be crazy optimizations and non-portable stuff like you see in other production regex implementations and in interpreters. It's pure ANSI C. The functions are all short -- no 1000 line monsters like I've seen in a lot of old C code lately. The rsc example code is actually a great example of using pointers in C. People rightly avoid lots of raw pointers for application code, but for this use case, they yield compact and elegant code.