Alternative to look-behind (was: [SVN] Revision 1203 (markdown))
Charilaos Skiadas
cskiadas at uchicago.edu
Fri Jun 24 04:53:19 UTC 2005
On Jun 23, 2005, at 11:17 PM, Allan Odgaard wrote:
> On 24/06/2005, at 5.21, Charilaos Skiadas wrote:
>
>
>> [...] the first star or underscore is also not preceded by an odd
>> number of backslashes and the second symbol is not preceded by an
>> even number of backslashes [...]
>>
>
> Sorry to use this as my example, but often look-behind can be
> avoided by instead making a rule that “eats” the escape sequence(s)
> one tries to avoid.
Actually, thanks for using this as your example. It is a particularly
elegant solution.
> So for example if we add this rule to markdown:
>
> { name = "constant.character.escape.markdown";
> match = "\\\\[-`*_#+.!(){}\\[\\]\\\\]";
> },
>
> Then we don't have to do anything special for the *emphasis* rule
> to handle: \*not-emphasis* or the dozen variants of this (and it
> should work for all constructs).
So this will not work as is for the closing *? I wonder, could we use
a begin-end-swallow pattern instead of a match?
> I'm leaving it to Hadley though to decide if he wants to include
> it! Probably you'd also want to switch to a one combined grammar
> now that 1.1b13 can do local includes and recursion.
Btw, I meant to say it earlier in relation to Brad's changes in the
LaTeX bundle, but THANK YOU, THANK YOU, THANK YOU!!!
Haris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate-dev/attachments/20050623/68548fdb/attachment.html>
More information about the textmate-dev
mailing list