[TxMt] Not getting all C symbols

William Bumgarner bbum at mac.com
Tue Mar 21 00:35:24 UTC 2006


On Mar 20, 2006, at 4:06 PM, David Chin wrote:
> Hi, I have a Python C module, and comments between the
> end of the arguments and the opening brace seem to screw
> up its ability recognize the function name:
>
>  static PyObject *
>  tableio_writeTable(PyObject *self, PyObject *args) /* args:  
> (string) */
>  {
>     / * function body */
>  }
>
> I'm not sure how to modify the module to get this to work.
> Putting that comment somewhere else makes it work fine,
> but I'd like to avoid having to go through the code and
> editing every function definition.

Go to the C bundle in the Bundle editor, search for  
'declaration.function.c', and make the following modification.

[albbum:TextMate/Bundles/C.tmbundle] bbum% svn diff
Index: Syntaxes/C.plist
===================================================================
--- Syntaxes/C.plist    (revision 2872)
+++ Syntaxes/C.plist    (working copy)
@@ -299,7 +299,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
+                                (\{|\n|//|/ 
*))                              # start bracket or end-of-line
                         </string>
                         <key>beginCaptures</key>
                         <dict>




More information about the textmate mailing list