It seems TextMate fails to notice a c++ function definition if I write it like this:
static void foo( void * a, void * b, void * x ) { }
but all on one line works fine:
static void foo( void * a, void * b, void * c ) { }
Has anyone else noticed this? Is there a way for me to fix this myself or should I wait for an update?
Thank you.
.niels
niels gabel
firewire cpu software apple computer, inc.
On 04/02/2006, at 0:58, Niels wrote:
It seems TextMate fails to notice a c++ function definition if I write it like this: [multi line function prototype] but all on one line works fine
Not knowing the syntax definition I am almost positive things like that won't work for multiple lines. It's not trivial to make it possible either.
-- Sune.
On Feb 3, 2006, at 8:45 PM, Sune Foldager wrote:
On 04/02/2006, at 0:58, Niels wrote:
It seems TextMate fails to notice a c++ function definition if I write it like this: [multi line function prototype] but all on one line works fine
Not knowing the syntax definition I am almost positive things like that won't work for multiple lines. It's not trivial to make it possible either.
It seems like it might be possible, but the attempts so far (that I've seen) have caught too many false positives (not actual functions).
Chris
Niels <noggin@...> writes:
It seems TextMate fails to notice a c++ function definition if I write it like this:
static void foo( void * a, void * b, void * x ) { }
but all on one line works fine:
static void foo( void * a, void * b, void * c ) { }
Has anyone else noticed this? Is there a way for me to fix this myself or should I wait for an update?
Thank you.
.niels
niels gabel
firewire cpu software apple computer, inc.
I've found the same problem. I think that 'begin' pattern of the declaration.function.c scope has a too much restrictive look ahead pattern.
--- Bundles/C.tmbundle/Syntaxes/C.plist (revision 2670) +++ Bundles/C.tmbundle/Syntaxes/C.plist (working copy) @@ -294,9 +294,7 @@ ) ) ([A-Za-z_][A-Za-z0-9_:]+) # actual name - \s*( (?=[^)]*) # match "(" and use look-ahead for ")" - (\s+const)?\s* # optional const modifier - ({|\n)) # start bracket or end-of-line + \s*( </string> <key>beginCaptures</key> <dict>
Kent.
On Feb 4, 2006, at 11:33 PM, Kent Sibilev wrote:
I've found the same problem. I think that 'begin' pattern of the declaration.function.c scope has a too much restrictive look ahead pattern.
--- Bundles/C.tmbundle/Syntaxes/C.plist (revision 2670) +++ Bundles/C.tmbundle/Syntaxes/C.plist (working copy) @@ -294,9 +294,7 @@ ) ) ([A-Za-z_][A-Za-z0-9_:]+) # actual name
\s*\( (?=[^)]*\) # match "(" and use look-ahead for
")"
(\s+const)?\s* # optional const modifier
(\{|\n)) # start bracket or end-of-line
\s*\(
</string> <key>beginCaptures</key> <dict>
In addition to function declarations, many function calls would be caught by that modification.
Chris