[SVN] r7628 (C)
Allan Odgaard
throw-away-1 at macromates.com
Sun Jul 1 05:36:18 UTC 2007
On 30. Jun 2007, at 02:17, Joachim Mårtensson wrote:
> [...] I did not want to change to much in existing rules before I know
> why things are as the are, perhaps someone can explain why the leading
> spaces are matched?
For prototypes we want to match just ‘name (…);’ in ‘type name (…);’.
But to avoid false positives like ‘new string();’, ‘else usage();’,
or even ‘return res && foo();’ we need to look at what is to the left
of ‘name (…)’.
We do this with look-behind, but since look-behind can only use fixed
width patterns, we match ‘ name (…)’ (i.e. the space(s)) and can then
use look-behind assertions to examine what’s to the left.
More information about the textmate-dev
mailing list