squaresLab / Rooibos

2 stars 0 forks source link

Incorrect location ranges reported when matching inside compounds #69

Closed ChrisTimperley closed 6 years ago

ChrisTimperley commented 6 years ago

Example

Template: a + b Source: foo(a + b + c + d) Expected: 1:4#1:9 Actual: 1:4#1:17

ChrisTimperley commented 6 years ago

This is close to being fixed, but the matcher is now including trailing whitespace as part of the match.

matched list to: [1:4::1:10]<C[1:4::1:5](a), W[1:5::1:6](" "), C[1:6::1:7](+), W[1:7::1:8](" "), C[1:8::1:9](b), W[1:9::1:10](" ")>
ChrisTimperley commented 6 years ago

The problem of including trailing whitespace has been fixed, but the match is still including leading whitespace that doesn't belong to the match.

ChrisTimperley commented 6 years ago

Fixed the leading whitespace problem. It looks like there may be issues when the template begins with whitespace, so I'll add a new test case to check that out.

ChrisTimperley commented 6 years ago

I've opened a new issue (#71) to deal with templates that start and/or end with whitespace.