I saw an old message on GMANE "Re: C syntax fixes" regarding this issue. I guess much of the patch did not get applied?
There seem to be a very significant issues (for me anyhow) with the current C syntax parser:
1) Multiple line function definitions are not tagged as functions, e.g.,
int test(int a, int b) { ... }
This is unfortunately very common with functions with large numbers of arguments.
2) Less importantly, simple macros such as #define __MY_HEADER_H are also getting listed in the function pull-down.
Does anyone have a patch for this that could get pushed into SVN? I have yet to grok the syntax of C plist etc, but this is driving me insane.
Thanks, Matt
On 22/10/2007, at 00:10, Matt Fago wrote:
I saw an old message on GMANE "Re: C syntax fixes" regarding this issue. I guess much of the patch did not get applied?
There seem to be a very significant issues (for me anyhow) with the current C syntax parser: [...]
Does anyone have a patch for this that could get pushed into SVN? I have yet to grok the syntax of C plist etc, but this is driving me insane.
http://lists.macromates.com/pipermail/textmate/2007-October/022739.html
On Oct 24, 2007, at 1:43 PM, Allan Odgaard wrote:
On 22/10/2007, at 00:10, Matt Fago wrote:
I saw an old message on GMANE "Re: C syntax fixes" regarding this issue. I guess much of the patch did not get applied?
There seem to be a very significant issues (for me anyhow) with the current C syntax parser: [...]
Does anyone have a patch for this that could get pushed into SVN? I have yet to grok the syntax of C plist etc, but this is driving me insane.
http://lists.macromates.com/pipermail/textmate/2007-October/ 022739.html
Thanks. Missed that message somehow.
What is the WIP branch (Work In Progress?), and when is the plan to merge this bundle into the trunk, or why hasn't it been (just curious)?
To help others Googling: I checked this bundle out via
svn co http://macromates.com/svn/Bundles/branches/WIP/Bundles/ C.tmbundle \ ~/Library/Application\ Support/TextMate/Bundles
and everything works fine (with respect to multi-line definitions anyhow).
Thanks, Matt
On 25/10/2007, at 04:33, Matt Fago wrote:
[...] What is the WIP branch (Work In Progress?), and when is the plan to merge this bundle into the trunk, or why hasn't it been (just curious)?
It is “Work in Progress”, yes.
The WIP C/C++ grammar is matching the full structure of your source code, there are 3 “concerns”:
1. It is more fragile (since an unforeseen or wrongly matched structure can throw it off). 2. It is somewhat slower than the regular grammar. 3. It doesn’t have as good support for the #if 0/1 … #else … #endif as the original grammar (since that structure is orthogonal with the structure of the actual C/C++ code).
Number 1 just means it needs testing to the point where I am confident it works :)
As for #2 and #3, for #2 we can only wait for TM 2.0 to really get that addressed and #3 either requires a lot of duplication in the grammar or also that we wait for TM 2.0 -- but as there is no ETA on TM 2.0, the question is if the demand for the improvements outweigh the tradeoffs, we haven’t really decided that, in the end I guess it is my call, and I am thinking we should make it trunk maybe in 1-2 months.
On Oct 24, 2007, at 9:52 PM, Allan Odgaard wrote:
The WIP C/C++ grammar is matching the full structure of your source code, there are 3 “concerns”:
- It is more fragile (since an unforeseen or wrongly matched
structure can throw it off). 2. It is somewhat slower than the regular grammar. 3. It doesn’t have as good support for the #if 0/1 … #else … #endif as the original grammar (since that structure is orthogonal with the structure of the actual C/C++ code).
Number 1 just means it needs testing to the point where I am confident it works :)
As for #2 and #3, for #2 we can only wait for TM 2.0 to really get that addressed and #3 either requires a lot of duplication in the grammar or also that we wait for TM 2.0 -- but as there is no ETA on TM 2.0, the question is if the demand for the improvements outweigh the tradeoffs, we haven’t really decided that, in the end I guess it is my call, and I am thinking we should make it trunk maybe in 1-2 months.
As a comment on the WIP C syntax: it seems to mark declarations as well as definitions as functions. Not as big of a deal as missing definitions, but probably not ultimately desirable. E.g.:
int testfn(int a); int testfn(int a) { ... }
leads to two "testfn" listings in the symbol menu. This may occur when one has static functions, etc.
Thanks, Matt
On 28 Oct 2007, at 20:17, Matt Fago wrote:
[...] As a comment on the WIP C syntax: it seems to mark declarations as well as definitions as functions. Not as big of a deal as missing definitions, but probably not ultimately desirable. [...]
Often desired when opening a header file.