[SVN] RFC: use first (not longest) match
Allan Odgaard
allan at macromates.com
Sun Aug 7 23:49:52 UTC 2005
On 06/08/2005, at 21.01, Jeroen van der Ham wrote:
>> Currently when finding a rule from the grammar, TextMate will use the
>> longest match, and in case of a tie, the first of these. [...]
> I think that in the python bundle I depend on the behavior of use the
> longest match. I think it would be possible to rearrange things so
> that
> this continues to work.
Yes, probably several bundles make use of it -- but I don't see any
technical reason to why re-arranging shouldn't always be able to
solve it.
I'll go through the bundles before making the change, to see how much
really needs changing. Long term I think it would be better with
taking the first match, since it'll be easier overriding included
rules, and because of the “broken” begin/end behavior.
>> Any objections?
> If people open the language definition files using the (Apple)
> Property
> List Editor, and save them, then AFAIK they are saved using
> alphabetical
> ordering, which could then break stuff.
No, that's only for dictionaries, where the patterns key/value pair
is an array.
More information about the textmate-dev
mailing list