Skip to content
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 helper function to determine if a location is in a range #891

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

suzizecat
Copy link
Contributor

Adds SourceRange::contains(SourceLocation) allowing to know if a source location is within the boundaries of the source range.


The objective is to know if a location is included in a range.
I assumed that the boundaries of the range are both included (hence the usage of <= and >= operators)

Please let me know if any update are required (or do not hesitate to make the changes yourself).

suzizecat and others added 2 commits February 11, 2024 12:27
Adds SourceRange::contains(SourceLocation) allowing to know if a source
location is within the boundaries of the source range.
Copy link

codecov bot commented Feb 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3ddb9b3) 93.76% compared to head (41d5cf1) 93.76%.
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #891   +/-   ##
=======================================
  Coverage   93.76%   93.76%           
=======================================
  Files         189      189           
  Lines       47018    47018           
=======================================
  Hits        44087    44087           
  Misses       2931     2931           
Files Coverage Δ
include/slang/text/SourceLocation.h 100.00% <ø> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3ddb9b3...41d5cf1. Read the comment docs.

@MikePopoloski MikePopoloski merged commit 150445d into MikePopoloski:master Feb 12, 2024
17 of 18 checks passed
@suzizecat suzizecat deleted the adds_range_contains branch February 13, 2024 08:23
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