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.


_______________________________________________
textmate-dev mailing list
[email protected]
http://lists.macromates.com/mailman/listinfo/textmate-dev

Reply via email to