Skip to content

Conversation

@johndoesstuff
Copy link
Contributor

@johndoesstuff johndoesstuff commented Nov 24, 2025

The error() function previously only showed a raw byte offset.
This PR adds proper 1-based line:column information while preserving the original diagnostic layout and caret position exactly.

No behaviour changes other than the added location output.
All tests pass, zero regressions.

Fixes the TODO in error().


Summary by cubic

Add 1-based line:column numbers to error diagnostics instead of a raw byte offset, preserving the caret line and diagnostic layout.

Written for commit c33b078. Summary will update automatically on new commits.

cubic-dev-ai[bot]

This comment was marked as resolved.

@jserv jserv requested review from ChAoSUnItY and DrXiao November 24, 2025 21:35
Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Check 'CONTRIBUTING.md' carefully and indent source files with 'clang-format-18'.

@johndoesstuff johndoesstuff force-pushed the fix/error-at-with-line-and-column branch from fcfa9fc to 34f235d Compare November 24, 2025 22:07
The original error() function only showed the raw byte offset and a
caret line, this change adds 1-based line and column numbers
while leaving everything else unchanged.

This is done by reusing start_idx and backtracking through SOURCE
to count newlines.
@johndoesstuff johndoesstuff force-pushed the fix/error-at-with-line-and-column branch from 34f235d to c33b078 Compare November 25, 2025 03:36
@jserv jserv merged commit c044948 into sysprog21:master Nov 26, 2025
9 checks passed
@jserv
Copy link
Collaborator

jserv commented Nov 26, 2025

Thank @johndoesstuff for contributing!

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