About "applyEndPatternLast"

Create issue
Issue #4 new
FichteFoll created an issue

I've noticed a while ago that you use a applyEndPatternLast key by implied syntax and suddenly became curious.

I was unable to find any documentation on this setting on the textmate docs, so by the name I assumed it would search for the end pattern first and then apply the patterns list only within the previously matched begin and end matches. I tried that in Sublime Text but it doesn't appear to work (I tested it with https://github.com/SublimeTextIssues/DefaultPackages/issues/30). I also tested by adding \' inside the string, but it was matched by the escape sequence include and not by the (')|(\n) end pattern.

So, what does it actually do? What I assumed? Or does Sublime Text just not interpret it correctly? ST did fail to load the syntax def when I first set this to a string ("1").

Comments (1)

  1. Kay-Uwe (Kiwi) Lorenz repo owner

    Hi FichteFoll,

    usually the algorithm matches the end pattern before the patterns in the list. If you pass applyEndPatternLast 1, then the patterns from the list are matched before end pattern.

    I found this in some textmate grammars, so I implemented it. I remember, I used it in restructured text grammar.

    Best regards, Kiwi

    Am 25.03.2015 um 04:39 schrieb FichteFoll:

  2. Log in to comment