Skip to content

Remove exception support from slicec#750

Merged
externl merged 5 commits intoicerpc:mainfrom
externl:remove-exceptions
Mar 30, 2026
Merged

Remove exception support from slicec#750
externl merged 5 commits intoicerpc:mainfrom
externl:remove-exceptions

Conversation

@externl
Copy link
Copy Markdown
Member

@externl externl commented Mar 30, 2026

  • 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

- 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
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 exception definitions and operation throws clauses from the Slice grammar, lexer tokens, and AST model.
  • Removed @throws doc 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>
Copy link
Copy Markdown
Member

@InsertCreativityHere InsertCreativityHere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

externl and others added 3 commits March 30, 2026 11:50
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>
@externl externl merged commit 5eada12 into icerpc:main Mar 30, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants