The regex backreferences were not properly parsed and used when using
the extended grammar. This change parses them.
The issue was found while working on bug 34297.
Differential D62451
Regex backreference [1/3] Fixes backreferences for extended grammar. Mordante on May 25 2019, 11:54 AM. Authored by
Details The regex backreferences were not properly parsed and used when using The issue was found while working on bug 34297.
Diff Detail
Event TimelineComment Actions I added a unit test in part 3 of the series [1]. Would you prefer to have the test for this fix in this patch? Comment Actions Ah yes, I didn't see that patch. I will defer to the code-owners on this, but my $0.02 are, if this patch were a feature or added/removed functionality I would say add the tests to this patch. But, because this patch only fixes a small bug, it should be OK if the tests come later. If for whatever reason the other patch does not make it, you will have to remember to make another patch with the tests. Comment Actions This looks quite reasonable to me, but I have to agree with Zoe here; since you've added behavior in this patch, the test for it should be in this patch as well. Especially since I'm not convinced that https://bugs.llvm.org/show_bug.cgi?id=34297 is actually a bug, rather than a "This might be nice"
Comment Actions I'm not a big fan of duplicated code; but especially in this case, since in D62453 you edit the duplicated code to add a throw; but you have to do it twice - once in __parse_backref and once in the new code. Why is that preferable? Comment Actions I think there is a minor misunderstanding. I don't mind to avoid duplicating code. But __parse_BACKREF can't be used in both places. So the question was which of the proposed APIs you prefer. I'll post patch with my preferred solution. I'll wait with updating D62453 until this patch is approved. Comment Actions @mclow.lists Do you still have a concern about code duplication? If not, I would go ahead and commit both this and https://reviews.llvm.org/D62453, and close http://llvm.org/PR34297. |
This looks like a copy/pasta of __first = __parse_BACKREF(__first, __last) to me.
How is it different?