Skip to content

Lexer rejects a UTF-8 BOM, and a lone \r does not end a line #9108

Closed

Description

@cristianoc

Found by a bug hunt over the 16 commits from eb087382 to cd641cbc.

UTF-8 BOM. A file that starts with a BOM is rejected by both bsc and bsc -format, with one "Not sure what to do with this character" error per BOM byte (\239, \187, \191):

printf '\xef\xbb\xbflet x = 1\n' > A.res
bsc A.res

Some Windows editors write a BOM by default.

Lone \r. A \r without a \n ends a // comment but does not count as a newline:

printf 'let x = 1 // c\rlet y = 2\n' > B.res
bsc B.res   # Consecutive statements on a line must be separated by ';' or a newline

Both reproduce at b123b7c3.

🤖 Generated with Claude Code

Activity

  1. added theissue type on Oct 28, 2026
  2. added a commit that references this issue on Oct 28, 2026
    467af56
  3. added a commit that references this issue on Oct 29, 2026
    b57b008
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions