Remove exception support from slicec#750
Merged
externl merged 5 commits intoicerpc:mainfrom Mar 30, 2026
Merged
Conversation
- Remove Exception type, its AST node variant, and all related grammar/parsing - Remove `throws` keyword and exception specifications from operations - Remove `@throws` doc comment tag and ThrowsTag type - Remove exception-related validators, encoding/type-ref patchers, and tests - Remove error code E041 (ExceptionSpecificationNotSupported) and renumber - Update doc comments, wrapper macros, and visitor trait accordingly
There was a problem hiding this comment.
Pull request overview
This PR removes exception support from the slicec compiler pipeline, including grammar/parsing, AST representation, patching/validation, diagnostics, and associated tests/documentation.
Changes:
- Removed
exceptiondefinitions and operationthrowsclauses from the Slice grammar, lexer tokens, and AST model. - Removed
@throwsdoc comment support and all exception-related validators/patchers/visitor hooks. - Deleted exception-focused test suites and updated remaining tests/error messages to reflect the new grammar and diagnostic code renumbering.
Reviewed changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| slicec/tests/parser_tests.rs | Updates expected parser error token list after removing exception. |
| slicec/tests/optional_tests.rs | Removes Slice1 optional tests that relied on exceptions; keeps non-exception optional behavior tests. |
| slicec/tests/interfaces/operations.rs | Removes tests for throws clauses and exception specification validation. |
| slicec/tests/exceptions/tags.rs | Removes exception tag tests (file deleted). |
| slicec/tests/exceptions/mode_compatibility.rs | Removes exception mode compatibility tests (file deleted). |
| slicec/tests/exceptions/mod.rs | Removes exception test module entrypoint (file deleted). |
| slicec/tests/exceptions/inheritance.rs | Removes exception inheritance tests (file deleted). |
| slicec/tests/exceptions/container.rs | Removes exception container/field tests (file deleted). |
| slicec/tests/exception_tests.rs | Removes top-level exception test harness module (file deleted). |
| slicec/tests/compilation_mode_tests.rs | Updates expected parser error token list after removing exception. |
| slicec/tests/comment_tests.rs | Removes @throws/throws usage from doc comment tests. |
| slicec/src/visitor.rs | Removes exception visitation APIs and traversal of exception definitions. |
| slicec/src/validators/operations.rs | Removes exception-spec validation and @throws doc-comment validation. |
| slicec/src/validators/mod.rs | Removes exception validation visit hook. |
| slicec/src/validators/identifiers.rs | Removes redefinition checking traversal for exceptions. |
| slicec/src/validators/cycle_detection.rs | Updates cycle-detection commentary after exception removal. |
| slicec/src/validators/comments.rs | Removes “only operations can throw” doc-tag validation logic. |
| slicec/src/slice_file_converter.rs | Makes AST->encoding conversion exhaustive without exception handling. |
| slicec/src/patchers/type_ref_patcher.rs | Removes patching of base exceptions and operation exception specs. |
| slicec/src/patchers/encoding_patcher.rs | Removes exception supported-encoding computation and related optional suggestion logic. |
| slicec/src/patchers/comment_link_patcher.rs | Removes @throws link resolution/patching and simplifies patch application signature. |
| slicec/src/parsers/slice/tokens.rs | Removes exception/throws token kinds. |
| slicec/src/parsers/slice/mod.rs | Removes exception_keyword/throws_keyword expected-token mapping. |
| slicec/src/parsers/slice/lexer.rs | Stops lexing exception/throws as keywords. |
| slicec/src/parsers/slice/grammar.rs | Removes exception construction and throws clause handling in operations. |
| slicec/src/parsers/slice/grammar.lalrpop | Removes exception and exception specification productions; updates operation production. |
| slicec/src/parsers/comments/tokens.rs | Removes @throws token kind. |
| slicec/src/parsers/comments/lexer.rs | Stops lexing/validating @throws tags. |
| slicec/src/parsers/comments/grammar.rs | Removes throws collection from DocComment construction. |
| slicec/src/parsers/comments/grammar.lalrpop | Removes ThrowsBlock grammar and integration. |
| slicec/src/grammar/wrappers.rs | Removes exception variants from Definition, Entities, and Attributables wrappers. |
| slicec/src/grammar/elements/operation.rs | Removes exception_specification from Operation. |
| slicec/src/grammar/elements/mod.rs | Removes exception module export wiring. |
| slicec/src/grammar/elements/exception.rs | Removes Exception element definition (file deleted). |
| slicec/src/grammar/comments.rs | Removes ThrowsTag and throws storage from doc comments. |
| slicec/src/grammar/attributes/oneway.rs | Updates oneway validation to consider only return types (no throws). |
| slicec/src/diagnostics/lints.rs | Updates lint documentation to remove @throws references. |
| slicec/src/diagnostics/errors.rs | Removes exception-spec error and renumbers diagnostic codes accordingly. |
| slicec/src/ast/node.rs | Removes Node::Exception and related conversions. |
| slicec/src/ast/mod.rs | Updates find_element docs example type away from Exception. |
| .vscode/cspell.json | Removes exception-related spelling entry (unthrowable). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
InsertCreativityHere
approved these changes
Mar 30, 2026
Member
InsertCreativityHere
left a comment
There was a problem hiding this comment.
Look good to me!
Only boring comment comments like usual : vP
| GrammarDefinition::Enum(v) => converter.convert_enum(v.borrow()), | ||
| GrammarDefinition::CustomType(v) => Symbol::CustomType(converter.convert_custom_type(v.borrow())), | ||
| GrammarDefinition::TypeAlias(v) => Symbol::TypeAlias(converter.convert_type_alias(v.borrow())), | ||
| _ => panic!("TODO: remove exceptions"), |
Co-authored-by: Austin Henriksen <austin.r.henriksen79@gmail.com>
Co-authored-by: Austin Henriksen <austin.r.henriksen79@gmail.com>
Co-authored-by: Austin Henriksen <austin.r.henriksen79@gmail.com>
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.
throwskeyword and exception specifications from operations@throwsdoc comment tag and ThrowsTag type