Skip to content

Conversation

@MoNyAvA
Copy link
Contributor

@MoNyAvA MoNyAvA commented Feb 4, 2026

Summary

adjusted skip_until to derive the span directly from the token text range (excluding trivia) and added a focused unit test that checks the returned TextSpan covers all skipped tokens and starts at the first non-trivia character.


Type of change

Please check one:

  • Bug fix (fixes incorrect behavior)

Why is this change needed?

Before this change, skip_until was computing SkippedElement spans from the raw parser offset, including leading trivia and stopping inside the token text. As a result, diagnostics for skipped tokens were slightly shifted and inconsistent with other span calculations.

@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

@orizi made 1 comment.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @MoNyAvA).


crates/cairo-lang-parser/src/parser_test.rs line 128 at r1 (raw file):

#[test]
fn skip_until_span_excludes_leading_trivia_and_covers_all_tokens() {

add tests in the parser diagnostics tests.

in a relevant file at crates/cairo-lang-parser/src/parser_test_data/diagnostics/

i don't have any idea what is the issue without that.

if no cairo code can create this issue - close PR.

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.

3 participants