Repository navigation
feat: migrate Silver compiler frontend to standalone Elise parsing engine - #19
Merged
Merged
Conversation
…ndalone Elise repo
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
It introduces build- and tooling-impacting regressions (missing Elise paths via workspace patching, dropped parse diagnostics, and invalid LSP token encoding edge cases) that should be fixed before merge.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This pull request migrates the Silver compiler workspace to a new bin/* layout and integrates the standalone Elise parsing engine into agc, alongside new/expanded tooling (LSP + module builder) and corpus-based parity/perf gates.
Changes:
- Reworks the workspace layout to
bin/agc,bin/aglsp, andbin/agsm, with updated repository docs and performance logs. - Introduces Elise-based source graph parsing plus corpus-wide parity/round-trip tests and benchmark harnesses.
- Adds/extends tooling: LSP features (semantic tokens, references, outline, formatting, inlay hints) and
agsmbuild pipeline.
File summaries
| File | Description |
|---|---|
| TODO.md | Elise roadmap and milestone checklist |
| README.md | Updates repo layout documentation |
| PERFLOG.md | Adds Elise perf benchmark entries |
| Cargo.toml | Switches workspace members; adds Elise patch override |
| AGENTS.md | Updates architecture/layout documentation |
| bin/agsm/Cargo.toml | New agsm crate manifest |
| bin/agsm/src/main.rs | agsm CLI entrypoint (clap) |
| bin/agsm/src/lib.rs | agsm library module exports |
| bin/agsm/src/build.rs | Sourcemap build orchestration |
| bin/agsm/src/extract.rs | Extends artifact extraction struct init |
| bin/aglsp/Cargo.toml | New aglsp crate manifest |
| bin/aglsp/src/main.rs | LSP server wiring + capabilities |
| bin/aglsp/src/util.rs | LSP position/span utilities |
| bin/aglsp/src/semantic_tokens.rs | LSP semantic token encoding |
| bin/aglsp/src/references.rs | Find-references + rename logic |
| bin/aglsp/src/inlay_hints.rs | Parameter/type inlay hints + tests |
| bin/aglsp/src/format.rs | Whitespace-only formatter + tests |
| bin/aglsp/src/document_symbols.rs | Outline/document symbols + tests |
| bin/aglsp/src/doc.rs | Doc comment parsing/rendering |
| bin/aglsp/src/diagnostics.rs | LSP diagnostics + import/cfg pipeline |
| bin/aglsp/src/completion.rs | Adjusts repo-root discovery in tests |
| bin/agc/Cargo.toml | Adds Elise git deps + criterion bench config |
| bin/agc/Cargo.lock | Adds nested lockfile under bin/agc/ |
| bin/agc/build.rs | Build script exports git metadata env vars |
| bin/agc/benches/corpus.rs | Corpus benchmark harness (legacy vs Elise) |
| bin/agc/.gitignore | Ignores .o/.out artifacts |
| bin/agc/tests/elise_source_graph.rs | Corpus lossless source graph test |
| bin/agc/tests/elise_item_parity.rs | Corpus item parity vs legacy parser |
| bin/agc/tests/elise_ast_parity.rs | AST parity smoke tests |
| bin/agc/src/lib.rs | Exposes new grammar module |
| bin/agc/src/main.rs | New agc binary entrypoint + argv normalization |
| bin/agc/src/driver.rs | Driver switches parse path to Elise hooks |
| bin/agc/src/grammar/mod.rs | Grammar module boundary + exports |
| bin/agc/src/grammar/parser.rs | Elise token-stream item parser to SourceGraph |
| bin/agc/src/grammar/lower.rs | SourceGraph → typed AST lowering stub |
| bin/agc/src/symbol_table.rs | New compiler symbol table implementation |
| bin/agc/src/parser/mod.rs | Parser module re-exports + comment extraction |
| bin/agc/src/parser/error.rs | Parse error types + suggestion helpers |
| bin/agc/src/parser/prt_table.rs | PRT grammar DSL + prediction table |
| bin/agc/src/parser/prt_parser.rs | Adds single-item parse entrypoint |
| bin/agc/src/parser/import_hook.rs | Import lowering now uses Elise graph + lowering |
| bin/agc/src/semantic/mod.rs | Re-exports semantic passes |
| bin/agc/src/semantic/typeck.rs | Updates repo-root discovery in tests |
| bin/agc/src/mangling.rs | Collision-safe symbol mangling + tests |
| bin/agc/src/intrinsics.rs | Adds atomic intrinsic name recognizer |
| bin/agc/src/link.rs | Linker orchestration + dynamic linker handling |
| bin/agc/src/diagnostics/mod.rs | New diagnostic renderer + typo suggestion utils |
| bin/agc/src/debug_info.rs | Debug info context + SourceMap utilities |
| bin/agc/src/codegen/mod.rs | Codegen API surface definitions |
| bin/agc/src/codegen/llvm_ir/mod.rs | LLVM IR generator state + structures |
| bin/agc/src/codegen/llvm_ir/json.rs | JSON macro codegen helpers |
| bin/agc/src/codegen/dwarf_bt.rs | Adjusts test paths for new layout |
| bin/agc/src/cfg.rs | New --cfg machinery + gating tests |
| bin/agc/src/attributes.rs | Attribute parsing/helpers + tests |
| bin/agc/src/format.rs | Type/attribute formatting utilities |
Review details
Suppressed comments (2)
bin/agc/src/driver.rs:883
- The main compile pipeline no longer reports parse errors: it sets
errorsto an empty vec and the existing error-reporting branch is now dead code, so invalid input may proceed with an empty/partial AST without any diagnostics.
bin/agc/src/parser/import_hook.rs:363 - Import parse failures now return a raw joined message string, losing the previous spanned diagnostic rendering (file:line:col + caret) that made import errors actionable.
- Files reviewed: 23/95 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1
to
+3
| //! The Silver grammar definition, expressed through elise.//! | ||
| //! This module is the boundary between the generic elise engine and the | ||
| //! Silver language: it owns the lexical spec (see [`lexspec`]) and the |
Comment on lines
+9
to
+19
| pub fn lower_source_graph(graph: &SourceGraph, file_id: usize) -> Program { | ||
| let src = graph.text(); | ||
| let root = graph.root(); | ||
| let mut comments = Vec::new(); | ||
|
|
||
| let root_span = Span::new(root.span().0, root.span().1); | ||
|
|
||
| let all_tokens = match crate::lexer::lex_with_source(src, file_id as u32) { | ||
| Ok(toks) => toks, | ||
| Err(_) => Vec::new(), | ||
| }; |
…ax errors with spans and fixing CI git dependency resolution
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request completes the migration of the Silver systems programming language compiler (
agc) from the legacy hand-written parser to Elise, a high-performance, lossless CST parsing engine.Key Changes
Standalone Elise Decoupling:
agctohttps://github.com/CierCier/elise.git(elise-core,elise-lex,elise-parse).bin/agc,bin/aglsp,bin/agsm).Lossless CST$\to$ AST Lowering Pipeline:
lower_source_graphinbin/agc/src/grammar/lower.rsto lower lossless green trees into typed Silverast::Programitems.bin/agc/src/driver.rsand module import lowering inbin/agc/src/parser/import_hook.rs.tests/elise_ast_parity.rs.Performance Improvements:
Verification & Test Results
cargo test --workspace: 451 tests passed, 0 failed.bash tests/run_tests.sh: 144 integration test suites passed, 0 failed (all RAII, move semantics, destructor flags, memory stress, and runtime networking suites).CierCier/elise.Greptile Summary
The PR migrates the Silver compiler frontend to the standalone Elise lexer and CST parser while retaining the existing typed AST and downstream compiler stages.
bin/.Confidence Score: 5/5
The PR appears safe to merge because no blocking failure remains established at the current head.
No blocking failure remains.
Important Files Changed
bin/agc,bin/aglsp, andbin/agsmlocations.Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Source[Silver source] --> EliseLex[Elise lexer] EliseLex --> CST[Lossless source graph] CST --> Lower[CST to Silver AST lowering] Lower --> Imports[Import lowering] Imports --> Semantic[Semantic and ownership checks] Semantic --> Codegen[LLVM code generation]Reviews (2): Last reviewed commit: "fix(ci, diagnostics): address review fee..." | Re-trigger Greptile
Context used: