Hi
I have changed
\s+
by
\s*
in the (L)anguage grammar for to C recognize also "name(args)" and not only "name (args)" as function prototype in C.
I did easily the change in the C bundle, but my question es:
is it the best way of changing an standard bundle?
if that bundle is updated in the future by the TM developers, will it be updated in my system?
Thanks
On Mar 3, 2007, at 7:40 PM, Juan wrote:
Hi I have changed \s+ by \s* in the (L)anguage grammar for to C recognize also "name(args)" and not only "name (args)" as function prototype in C.
I did easily the change in the C bundle, but my question es:
is it the best way of changing an standard bundle?
If the change is one that should probably take place in the bundle anyway, then it is best to mention it to the maintainer of the bundle / this list, so that the official bundle can be changed accordingly. A diff of the file before and after would be particularly helpful in this case.
if that bundle is updated in the future by the TM developers, will it be updated in my system?
The syntax will not, since there is a local modification to it (see: http://blog.circlesixdesign.com/2007/03/02/textmate-bundles- explained/ ). But the rest of the bundle will be updated just fine.
To be precise, the syntax in the TextMate application itself will also be updated, but there will be another version of the file, the one with your changes, under ~/Library/Application Support/TextMate, and it will take precedence when TM looks for the syntax.
Thanks
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On 4. Mar 2007, at 01:40, Juan wrote:
I have changed
\s+ by \s*
in the (L)anguage grammar for to C recognize also "name(args)" and not only "name (args)" as function prototype in C.
FYI the reason why I decided to make it \s+ was that I got false positives e.g. like:
string str("foo");
Which is a variable declaration, not a function declaration. Technically we probably could improve the patterns to check if the “arguments” follow a “type variable” pattern, though then we have stuff like:
int main(void);
I did easily the change in the C bundle, but my question es:
is it the best way of changing an standard bundle?
if that bundle is updated in the future by the TM developers, will it be updated in my system?
The bundle will be updated, but when changing a language grammar, you fork that grammar.
I guess the best way to have a locally modified grammar, but still have it updated with “official” changes is to checkout the bundle from the subversion repository into ~/Library/TextMate/Application Support/Bundles, then regularly svn up it, and fix the potential merge conflicts that can arise, if the default bundle is changed in a way that overlaps with the local changes.