Skip to content

🐛 Report parenthesis-delimited blocks as parsing failures - #618

Closed
MiWeiss wants to merge 1 commit into
mainfrom
fix/report-parenthesis-delimited-blocks
Closed

🐛 Report parenthesis-delimited blocks as parsing failures#618
MiWeiss wants to merge 1 commit into
mainfrom
fix/report-parenthesis-delimited-blocks

Conversation

@MiWeiss

@MiWeiss MiWeiss commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Standard BibTeX allows (...) as block delimiters. The splitter's mark regex only recognised {, so such blocks were silently swallowed as implicit comments — no entry, no warning, no failed block:

Splitter('@article(test2002, author = {A}, year = {2002})').split()
# -> 0 entries, 1 ImplicitComment, 0 failed blocks

@type( now produces a ParsingFailedBlock naming the unsupported delimiter, and parsing resumes after the closing parenthesis so subsequent {-delimited blocks still parse. Applies uniformly to @comment(, @string( and @preamble( too.

This is fail-closed only — it does not add parenthesis support. It only makes the loss visible; the raw text is still preserved on the failed block.

Tests: 29 new cases in tests/splitter_tests/test_splitter_parenthesis_blocks.py (issue repro, recovery, line numbers, stray ( inert). Full suite green: 2759 passed, 12 skipped.

Fixes #533

🤖 Generated with Claude Code

Standard BibTeX allows `(...)` as block delimiters. The splitter's mark
regex only recognised `{`, so `@article(key, ...)` was silently swallowed
as an implicit comment: no entry, no warning, no failed block.

Such blocks now yield a ParsingFailedBlock naming the unsupported
delimiter, and parsing resumes after the closing parenthesis so that
subsequent brace-delimited blocks still parse. This is fail-closed only;
parenthesis-delimited blocks are still not parsed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.

Parenthesis-delimited blocks (@article(...)) are silently parsed as implicit comments

1 participant