[TxMt] C Bundle: Function detection fails when arguments are spread over several lines

Allan Odgaard throw-away-2 at macromates.com
Fri Oct 19 02:47:40 UTC 2007


On 20/09/2007, at 16:49, Angelo Laub wrote:

> I've noticed a bug in the function detection of the C language Bundle.
>
> A function is not properly recognized when the arguments are spread
> over several lines. This causes the syntax highlighting to be broken
> and the function will not appear in the 'Jump to function' popup list.
>
> I've attached a patch to the C syntax file which corrected the problem
> for me. I haven't noticed any side-effects so far but I don't know if
> it's really the best solution.
>
> Allan, I would be glad if you could incorporate a fix to this issue in
> an upcoming release.

Sorry about the late reply -- the problem with your patch is that it  
will also recognize function calls, split over multiple lines, as  
function prototypes.

For example:

     printf("%s\n",
         "Hello world");

If you checkout the WIP branch of the C/Objective-C bundles, Joachim’s  
grammar should handle multi-line prototypes quite well.




More information about the textmate mailing list