Chapter 8: Loops

Seven done of Writing a C Compiler , a few more to go. Now is the time for loops. Lexer, AST and Parser The lexer is just a few new keywords. Been there, done that. Changes to the AST are more interesting. No less than five new statements, one for every new keyword. Here is the new Stmt without further ado: pub const Stmt = union ( enum ) { @"return": * Expr, expr: * Expr, @"if": struct { cond: *…