limetext / sublime

Support Sublime Text 3 packages for LimeText
BSD 2-Clause "Simplified" License
13 stars 8 forks source link

invalid backref number #10

Open zoli opened 8 years ago

zoli commented 8 years ago

Some tmLanguage files have patterns with begin and end, If the end regex has backrefer number like this It raises invalid backref number error because we aren't relating begin and end regex on compiling.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/36385265-invalid-backref-number?utm_campaign=plugin&utm_content=tracker%2F35047411&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F35047411&utm_medium=issues&utm_source=github).
ricochet1k commented 7 years ago

Depends on exactly how the parser works, but it seems to me that replacing the backreferences by an escaped version of the match in the beginning might be the best way to do it. Compiling different regexes for each match is kinda annoying though.