pvl / abap.tmbundle

TextMate support for ABAP
20 stars 9 forks source link

lookbehind fix? #80

Closed larshp closed 1 year ago

larshp commented 2 years ago

https://github.com/pvl/abap.tmbundle/issues/79

split into two fixed width expressions

however, I dont remember how to test the grammar, hmm

FreHu commented 2 years ago

There was a test app, but it was deprecated https://github.com/github/linguist/issues/5844

mbtools commented 1 year ago

Two / after the a-z need to be escaped but then it should work:

https://regex101.com/r/1b5b8w/1

(?i)(?<=(?:\s|~|-))(?<=(?:->|=>))([a-z_\/][a-z_0-9\/]*)(?=\s+(?:=|\+=|-=|\*=|\/=|&&=)\s+)

mbtools commented 1 year ago

Here's what the change should look like:

            <dict>
                <key>match</key>
                <string>(?i)(?<=(?:\s|~|-))(?&lt;=(?:-&gt;|=&gt;))([a-z_\/][a-z_0-9\/]*)(?=\s+(?:=|\+=|-=|\*=|\/=|&amp;&amp;=)\s+)</string>
                <key>name</key>
                <string>variable.other.abap</string>
            </dict>

I tested it at https://novalightshow.netlify.app/.

larshp commented 1 year ago

close this PR and open a new?

mbtools commented 1 year ago

sure but i'm not authorized here