Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Conversation

nex3
Copy link
Contributor

@nex3 nex3 commented Jul 2, 2024

Tracking raw ints can be more efficient than tracking LineScannerState objects, and allows users to do small manual manipulations on the resulting positions.

@kevmoo kevmoo requested review from devoncarew and natebosch July 2, 2024 23:43
@natebosch
Copy link
Contributor

Can you add a brief description of the use case to the first comment so I can include it in the commit message?

Tracking raw ints can be more efficient than tracking
`LineScannerState` objects, and allows users to do small manual
manipulations on the resulting positions.
@nex3 nex3 force-pushed the span-from-position branch from 5063763 to 5df0981 Compare July 9, 2024 20:39
@nex3 nex3 requested a review from natebosch July 9, 2024 20:39
Comment on lines +100 to +102
/// Throws a [RangeError] if [startPosition] or [endPosition] aren't within
/// this source file.
FileSpan spanFromPosition(int startPosition, [int? endPosition]) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to add the RangeError.checkValidRange call in this implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, this one is handled automatically by SourceFile.

@natebosch natebosch merged commit a40bbbd into dart-archive:master Jul 9, 2024
@natebosch
Copy link
Contributor

Thanks! I'll start getting this rolled so that we can publish.

@natebosch
Copy link
Contributor

mosuem pushed a commit to dart-lang/tools that referenced this pull request Dec 11, 2024
…anner#78)

Tracking raw ints can be more efficient than tracking
`LineScannerState` objects, and allows users to do small manual
manipulations on the resulting positions.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants