17 matches across 1 files for TODO lang:Markdown path:compiler/docs/rust-port/rust-port-0004-build-hir.md
snippet_mode: auto · sorted by relevance
compiler/docs/rust-port/rust-port-0004-build-hir.md MARKDOWN 17 matches · showing 5 view file →
7The Rust port should be structurally as close to the TypeScript as possible: viewing the TS and Rust side by side, the logic should look, read, and feel similar while working naturally in Rust.
8
9**Current status**: M1-M13 fully implemented. All statement types, expression types, destructuring, function expressions, JSX, switch/try-catch, for-of/in, optional chaining, and recursive lowering are complete. No `todo!()` stubs remain. `cargo check` passes. Remaining work: test against fixtures and fix divergences from TypeScript output.
10
11**Known issues to fix:**
· · ·
232Following the port notes:
233- `CompilerError.invariant(cond, ...)` → `if !cond { panic!(...) }` or dedicated `compiler_invariant!` macro
234- `CompilerError.throwTodo(...)` → `return Err(CompilerDiagnostic::todo(...))`
235- `builder.recordError(...)` → `builder.record_error(...)` (accumulates on Environment)
236- Non-null assertions (`!`) → `.unwrap()` or `.expect("...")`
· · ·
238The `lower()` function returns `Result<HirFunction, CompilerError>` for invariant/thrown errors, while accumulated errors go to `env.errors`.
239
240### 6. `todo!()` Strategy for Incremental Implementation
241
242BuildHIR is too large (4555 lines) for a single implementation pass. Use Rust's `todo!()` macro to stub unimplemented branches:
· · ·
242BuildHIR is too large (4555 lines) for a single implementation pass. Use Rust's `todo!()` macro to stub unimplemented branches:
243
244```rust
· · ·
249 ast::Statement::BlockStatement(s) => lower_block_statement(builder, s),
250 // Stubbed — will be filled in later milestones
251 ast::Statement::ForStatement(_) => todo!("lower ForStatement"),
252 ast::Statement::WhileStatement(_) => todo!("lower WhileStatement"),
253 ast::Statement::SwitchStatement(_) => todo!("lower SwitchStatement"),
+ 12 more matches in this file
Search syntax
auth loginboth terms (AND is implicit)
auth OR logineither term
NOT path:vendorexclude matches
"exact phrase"quoted exact match
/func\s+Test/regex
handler~1fuzzy (Levenshtein 1)
file:*_test.gofilename glob
path:pkg/auth/**full path glob
lang:golanguage filter

Search any public repo from your terminal

This page calls POST /api/v1/code_search. Same tool, available over MCP for Claude/Cursor/Copilot.