Adding Features
This guide describes the expected workflow to add a language feature to NyxLang.
Workflow checklist
Section titled “Workflow checklist”-
Grammar
- update
c11.y(andc11.lif new tokens are needed)
- update
-
AST
- add/modify node kinds in
ast.zig
- add/modify node kinds in
-
Semantic analysis
- validate legality and types in
semanticAnalyzer.zig - update
scope.zig/variables.zigas needed
- validate legality and types in
-
IR lowering
- lower new node(s) into 3AC in
3ac.zig
- lower new node(s) into 3AC in
-
Backend
- implement RV32 lowering in
assembler.zig
- implement RV32 lowering in
-
Tests
- add a minimal repro program
- verify: parse → sema → IR → asm → run (if you have an execution harness)
Good contributor habits
Section titled “Good contributor habits”- Start with the smallest feature slice
- Keep dumps of AST/IR/ASM for debugging
- Document new invariants in the relevant docs page