This patch improves execution of the class-, function- and mixed-parsers:
Allows comments within definitions
e.g.
~~~~
:::c++
type // comment
function_name / comment / ( // comment
type / comment / argument / comment /
type / comment / argument / comment /
) / comment /
{
/ comment /
};
~~~~~
Definitions embedded in block/multiple-line comments are discarded
e.g.
~~~~
:::ruby
=begin
def MethodName1( arg1, arg2, arg3, ... )
return value
end
=end
def multiply (val1, val2 )
result = val1 * val2
return result
end
alias docalc multiply # line comment
~~~~
NOTE:
The parser definitions in the functionList.xml-file had to be adapted to comply with the changes of the patch.
Some of the parser definitions have been adapted:
The other parsers are still work in progress.
Thank you for the patch.
It's hard to see your modification from the patch, Could you attach your modified files directly please:
functionListPanel.cpp
functionListPanel.h
functionParser.cpp
functionParser.h
Don
Hi Don, do you have any schedule for including this patch? I did not tested the fix yet but "suffered" from the bug when adding COBOL parser for function list in [patches:#597] (which needs a tweak but likely performs better after applying this patch).
Simon
Related
Patches: #597
Sure, here they are...
Latest ...
Merged with revision 1272
I've built 6.6.9 with the above files and installed the provided
functionList.xml
. It's worth noting that the Boost root needs to be added to the include path for the project, and the library path also needs to point to wherever the built libraries have been placed. (Makes a difference if you build Boost withstage
defined.)For C++, it locates few if any functions in the various Notepad source files I've loaded, even those without comments prior to the '{'. For instance, in
functionListPanel.cpp
, it locates onlyfunclstToolbarProc()
; no functions at all inNppIO.cpp
.In JavaScript, it fails to locate function definitions declared as members of an instantiated class, which is standard practice. (This style is correctly recognized with 6.6.9's original function list, except for the comment problem.) Example:
f1
is a function here:Even for more C-like function declarations, which are identified, the parameter list is not included in the panel's display.
For Python, the items shown in the panel include the line's indentation and the
def
keyword. It would be better if the member functions could be grouped under the class name where they are defined.Last edit: Mike Cowperthwaite 2014-10-18
My bad, I should have mentioned I used the Boost::RegEx library in the patch and therefore the library needs to be included e.g. by adding the appropriate include- and library-paths in the project settings.
The parsers are still a work in progress. Feel free to propose updates!
See attached images of before and after patch-#548-applied views of an example JavaScript file.
Last edit: Menno Vogels 2015-03-24
This patch is still not merged. I just wondered about the "why", can anyone explain it to me?
Thank you,
Simon
Redump.
@Menno: Can you please update the files to current rev (if necessary, if not just say so) and tell us if you know of potential problems using them?
@Don: What about including this patch? I'd like to update [patches:#597] and know if I can base it on NPP with or without this patch.
Thank you!
Related
Patches: #597