feat: add ast and parser implementation
This commit is contained in:
@@ -15,15 +15,13 @@ A Rust-flavored, C-targeting language - built pipeline-first.
|
||||
|
||||
## Phase 2 - Parser
|
||||
|
||||
- [ ] Write grammar for the base subset
|
||||
- `fn` declarations, `return`, `let`, int/bool literals
|
||||
- Arithmetic (`+`, `-`, `*`, `/`), comparison (`==`, `!=`, `<`, `>`)
|
||||
- Function call expressions
|
||||
- [ ] Implement recursive-descent parser
|
||||
- [ ] Build typed AST: `FnDecl`, `Block`, `ReturnStmt`, `LetStmt`, `BinExpr`, `CallExpr`, `Literal`, `Ident`
|
||||
- [ ] Attach source spans to every AST node
|
||||
- [ ] Emit structured parse errors with span info
|
||||
- [ ] Unit-test: parse valid snippets, expect correct AST shapes
|
||||
- [x] Write grammar for the base subset
|
||||
- `fn` declarations, `return`, int/bool literals
|
||||
- Arithmetic (`+`, `-`, `*`, `/`)
|
||||
- [x] Implement recursive-descent parser
|
||||
- [x] Attach source spans to every AST node
|
||||
- [x] Emit structured parse errors with span info
|
||||
- [x] Unit-test: parse valid snippets, expect correct AST shapes
|
||||
|
||||
## Phase 3 - Semantic Analysis
|
||||
|
||||
|
||||
Reference in New Issue
Block a user