Skip to content

fix: Skip BOM (Byte order mark) (nucleus #2)#4

Open
brandon-coproduct wants to merge 1 commit intomasterfrom
nucleus/fix-issue-2
Open

fix: Skip BOM (Byte order mark) (nucleus #2)#4
brandon-coproduct wants to merge 1 commit intomasterfrom
nucleus/fix-issue-2

Conversation

@brandon-coproduct
Copy link

Summary

Automated fix for #2 by Nucleus safe PR fixer.

Security

  • Profile: safe_pr_fixer
  • The agent could read, write, edit, and commit — but could NOT push or create this PR.
  • This PR was created by the trusted CI script, not the agent.
  • All agent actions were audit-logged with HMAC signatures.

Review Checklist

  • Changes are scoped to the reported issue
  • Tests pass
  • No unexpected file modifications

Implements automatic detection and removal of UTF-8 BOM (U+FEFF / 0xEF 0xBB 0xBF)
from the beginning of:
- Input text passed to Lark.parse() (both str and bytes)
- Grammar content read from file-like objects via Lark.__init__()

This fixes parsing failures when text editors (especially on Windows) add
UTF-8 BOM to files. BOM is only stripped from the beginning, not from the
middle of text, ensuring correct behavior.

Fixes #2

Co-Authored-By: Claude Sonnet 4 <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.

2 participants