Closed Rainrider closed 2 years ago
@Rainrider could you add the test stuff to the code? Just leave it there commented out, it could be pretty handy in the future. Or alternatively, add a comment with a link to this PR or Gist with the test code.
Also, did you test the strip
func?
As for changing the tag syntax, I'm open to it, just make a new PR and label it as next major
.
@ls- Nope, missed the strip ofc. Will take a look later, the weather here is way too fantastic to miss out. As for the test "case" I'd rather squash merge, which will add a ref to the PR, and I'll mention it in the commit message, if you are fine with this.
strip
should be fine, there is nothing special there and the fix doesn't change the tag syntax, so if it is broken, it was that way before as well.
@Rainrider it'd be nice to have a reminder in the comments that there's a test case people, us included, can take a look at. Like, in 6-12mo I won't even remember what's going on in there 😁 And have fun 🏖
And yeah, strip
works just fine, dw
[test:tag] ==> [test:tag] 0
[prefix$>test:tag] ==> [test:tag] 0
[test:tag<$suffix] ==> [test:tag] 1
[prefix$>test:tag<$suffix] ==> [test:tag] 1
[test:tag(args)] ==> [test:tag] 0
[prefix$>test:tag(args)] ==> [test:tag] 0
[test:tag<$suffix(args)] ==> [test:tag] 1
[prefix$>test:tag<$suffix(args)] ==> [test:tag] 1
[ ($>test:tag<$)] ==> [test:tag] 1
[ ($>test:tag<$)(args)] ==> [test:tag] 1
This fixes
'[ ($>test:tag<$)]'
resulting in(42
instead of(42)
in a backwards compatible way.Here a simple use case for testing in case I missed something:
This breaks with something like
'[ ($>test:tag<$(suffix)(args)]'
which is IMO a limitation of the current tag syntax. We should have placed the argument list before the suffix delimiter. The following solution would fix this but in a backwards incompatible way: