On 10/31/2003 10:31:16 AM, Pauli Lindgren wrote:
>On 8/27/2003 1:18:52 AM, Ian Binnie
>wrote:
>>
>>I changed the line (line 57):-
>...
>... //Allow C++ comment IB 27/08/03
>>so that C++ comments are permitted after ")"
>
>The version that was in my web site was
>quite an old version. I have done
>several improvements to the search
>string since then.
>It now finds functions with C or C++
>comment on the same line or on a
>separate line (between the function name
>and { brace). A preprocessor command is
>allowed, too, as well as whitespace at
>the end of line.
>
>I finally managed to update my web page,
>so the new version is there. (There are
>many other new and updated macros, too.)
>
>A handy new feature in cfunc1w.vdm is
>the search option. It works in similar
>fashion as Vedit's incremental search.
>Just start typing characters, and the
>first function that matches the string
>is selected. You can then use up/down
>keys to browse through other functions
>that match the string. (I found I need
>this feature since some of the files I
>work on may have up to 150 functions.)
>
>>
>>I also added code to advance over any whitespace at start
>>of line beginning function declaration:-
>
>Maybe I add this into my new version of
>cfunc1w.vdm.
>I will update it to my web page after I
>have tested it.
>
>--
>Pauli
>
I have modified the CFUNC.VDM - Show and select 'C' program functions supplied with VEDIT (32-Bit) Ver. 6.13.1 09/07/04
My earlier change to advance over any whitespace at start of line beginning function declaration unfortunately caused if, while, for, switch, else if to be listed.
These are now skipped.
I included Pauli's "Allow comment at start of line PL 27.01.2004" and also his improvements to comment handling.
I have found some programs using a new way to confuse the macro, by including C comments on the line after ")" but before "{", and now handle this.
It also allows C++ initialisation lists after ")"
The key to this macro is the line:-
Search("|041|[|W]|[|[|L]/*|M*/|[|W],|[|L]//|M|L,|[|X]:|M|L,|L#|M|L]|[|L]|[|L]|[|W]|123",ERRBREAK) //IB 23/09/04
This is difficult to follow, so I made description to help me make the changes, which may be of interest.
Search("
|041 )
|[|W] optional space
|[ optional
|[|L] optional newline
/*|M*/ C comment
|[|W] optional space
, or
|[|L] optional newline
//|M|L c++ comment
, or
|[|X] optional extended space
:|M|L initialisation list
, or
|L
#|M|L preprocessor directive
]
|[|L] newline
|[|L]
|[|W]
|123 {
",ERRBREAK)
|
|