Skip to content

fix(formatter): preserve by and semicolon for bare genai ability declarations #5607

Open
Developer-Linus wants to merge 4 commits intojaseci-labs:mainfrom
Developer-Linus:fix/formatter-preserve-by-semicolon
Open

fix(formatter): preserve by and semicolon for bare genai ability declarations #5607
Developer-Linus wants to merge 4 commits intojaseci-labs:mainfrom
Developer-Linus:fix/formatter-preserve-by-semicolon

Conversation

@Developer-Linus
Copy link
Copy Markdown
Collaborator

Summary

Fixes a formatter bug where bare genai ability declarations like
def foo(...) -> T by <name>; lost the by keyword and trailing ;.

Root Cause

DocIRGenPass.exit_name only rendered the name text and ignored child tokens (KW_BY, Semi) attached to the Name node.

Fix

Update exit_name to detect KW_BY in nd.kid, include the by keyword, and preserve the trailing semicolon:


by <name>;

Test

Adds a regression test to ensure:

  • by is preserved
  • Output ends with ;
  • by llm; appears correctly
  • Formatter is idempotent

Files Changed

  • doc_ir_gen_pass.impl.jac — fix exit_name
  • test_jac_format_pass.jac — add regression test

Comment thread jac/tests/compiler/passes/tool/test_jac_format_pass.jac
@kugesan1105 kugesan1105 linked an issue Apr 20, 2026 that may be closed by this pull request
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.

Fix: Formatter related to byllm function

2 participants