Dot parser#7
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a TypeScript DOT parser and shifts DOT-string rendering to a “parse to Graph JSON → WASM render” pipeline, alongside updating tests/snapshots and simplifying parts of the vendored Graphviz build.
Changes:
- Added a new
src/lexer.tsDOT lexer/parser (parseDot) and integrated it intoViz._renderInput()for string inputs. - Updated backend request types to accept only a
Graphobject (removed DOT-string input path) and adjusted the WASM module accordingly. - Refreshed tests/snapshots and tightened lint/TS config (including
erasableSyntaxOnly).
Reviewed changes
Copilot reviewed 21 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | Enables erasableSyntaxOnly and normalizes trailing commas. |
| eslint.config.js | Adds a few stricter ESLint rules (unnecessary-condition, switch-case braces, number literal casing). |
| cspell.yml | Adds ellipsize to dictionary. |
| src/viz.ts | Parses DOT strings via parseDot() and forwards a Graph JSON payload to WASM; preserves parser warnings. |
| src/lexer.ts | New DOT lexer/parser implementation. |
| src/graph.d.ts | Adjusts optional property types / Attributes to allow undefined values. |
| backend/src/vizjs_types.zig | RenderRequest now always contains a Graph (removes DOT-string union). |
| backend/src/wasm_module.zig | Removes agmemread DOT parsing path; always constructs Graphviz graphs from JSON. |
| backend/src/agrw.h / backend/src/agrw.c / backend/src/wasm_module.zig | Renames/adjusts default-attr setters used by WASM. |
| backend/build.zig | Stops compiling removed scan.c / grammar.c sources and drops related include paths. |
| test/* | Updates inline snapshots/error messages; adds DOT language parity tests and new circo .dot snapshot. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2e11d05 to
ea887d8
Compare
ea887d8 to
4aae7ab
Compare
5ca59c8 to
5df7f5a
Compare
f71ae1e to
5b7e208
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 20 out of 21 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
8589c43 to
2be3d49
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 21 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 28 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 28 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request replaces the C-based DOT parser with a custom TypeScript implementation, refactors graph normalization, and updates the WebAssembly interface to use a JSON-based representation. It also introduces structured error reporting with source locations and code frames. Review feedback identifies a bug in string escape handling and suggests addressing several FIXME items related to default node labels, error message formatting, and compass point validation.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request replaces the existing Bison/Flex-based DOT parser with a new TypeScript implementation and introduces a graph normalization layer to handle attribute inheritance and edge deduplication. The backend WASM module and data structures have been refactored to support a new JSON-based communication format, and enhanced diagnostic reporting with source locations has been added. Feedback identifies a bug in the edge deduplication logic for strict graphs, where the inclusion of port and key attributes in the deduplication key prevents correct merging of edges between the same nodes.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 27 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
No description provided.