Wow, perfect timing! I'm currently writing my first lexer/parser in D as well (<a href="http://github.com/landaire/hsc" rel="nofollow">http://github.com/landaire/hsc</a>) for a Scheme-like language used in Halo 3. I found Rob Pike's talk on lexical scanning to be pretty useful (<a href="https://www.youtube.com/watch?v=HxaD_trXwRE" rel="nofollow">https://www.youtube.com/watch?v=HxaD_trXwRE</a>) and I've modeled mine pretty heavily after the text/template lexer: <a href="https://golang.org/src/text/template/parse/lex.go" rel="nofollow">https://golang.org/src/text/template/parse/lex.go</a>.
I've never seen the D language before and I have to admit, it looks very elegant and has piqued my interest. Thanks for your post.<p>I'm wondering why you used D rather than Rust? Was it just that you were curious about the D language or is there something about Rust that you don't like?