[TxMt] Re: C++ parser problem?

Kent Sibilev ksruby at gmail.com
Sun Feb 5 04:33:33 UTC 2006


Niels <noggin at ...> 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.







More information about the textmate mailing list