Skip to content

Commit

Permalink
Fix off by one error. (#426)
Browse files Browse the repository at this point in the history
* Fix off by one error in the secondary match of a `finding-region` rule.
  • Loading branch information
gfs authored Jan 21, 2022
1 parent c055aa3 commit 4c95dbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Pipelines/templates/nbgv-set-version-steps.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
steps:
- script: 'dotnet tool install -g nbgv'
- script: 'dotnet tool update -g nbgv'
displayName: 'Install GitVersioning'
- task: PowerShell@2
displayName: Set Release Version
Expand Down
4 changes: 2 additions & 2 deletions RulesEngine/WithinOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ public OperationResult WithinOperationDelegate(Clause c, object? state1, object?
{
var startLine = tc.GetLocation(capture.Index).Line;
// Before is already a negative number
var start = tc.LineEnds[Math.Max(1, startLine + wc.Before)];
var start = tc.LineStarts[Math.Max(1, startLine + wc.Before)];
var end = tc.LineEnds[Math.Min(tc.LineEnds.Count - 1, startLine + wc.After)];
var res = ProcessLambda(tc.FullContent[start..end], capture);
var res = ProcessLambda(tc.FullContent[start..(end+1)], capture);
if (res.Result)
{
if (res.Capture is TypedClauseCapture<List<Boundary>> boundaryList)
Expand Down

0 comments on commit 4c95dbd

Please sign in to comment.