-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a SpanScanner.spanFromPosition()
method
#78
Conversation
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.
/// Throws a [RangeError] if [startPosition] or [endPosition] aren't within | ||
/// this source file. | ||
FileSpan spanFromPosition(int startPosition, [int? endPosition]) => |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
Thanks! I'll start getting this rolled so that we can publish. |
…er#78) Tracking raw ints can be more efficient than tracking `LineScannerState` objects, and allows users to do small manual manipulations on the resulting positions.
Tracking raw ints can be more efficient than tracking
LineScannerState
objects, and allows users to do small manual manipulations on the resulting positions.