From 38037035e4a88c4f20fd066a304ff16cc6ea127a Mon Sep 17 00:00:00 2001 From: Don HO Date: Sat, 29 Aug 2020 02:06:06 +0200 Subject: [PATCH] Fix some Perl functions not being recognized in function list issue Fix Perl functions without parentheses / with attributes are not recognized in function list issue. Fix #4265, close #4266 --- PowerEditor/Test/FunctionList/perl/unitTest | 4 ++++ PowerEditor/Test/FunctionList/perl/unitTest.expected.result | 2 +- PowerEditor/src/functionList.xml | 6 ++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/PowerEditor/Test/FunctionList/perl/unitTest b/PowerEditor/Test/FunctionList/perl/unitTest index 7a74682b8..75cc42f5b 100644 --- a/PowerEditor/Test/FunctionList/perl/unitTest +++ b/PowerEditor/Test/FunctionList/perl/unitTest @@ -148,6 +148,10 @@ sub VarNames($) return (@vars); } +sub functionNoParentheses { + return 1 +} + ############### Start ############### print "\npltags $VERSION by Michael Schaap \n\n"; diff --git a/PowerEditor/Test/FunctionList/perl/unitTest.expected.result b/PowerEditor/Test/FunctionList/perl/unitTest.expected.result index dbc771253..4dab7d3d3 100644 --- a/PowerEditor/Test/FunctionList/perl/unitTest.expected.result +++ b/PowerEditor/Test/FunctionList/perl/unitTest.expected.result @@ -1 +1 @@ -{"leaves":["MakeTag","PackageName","SubName","VarNames"],"root":"unitTest"} \ No newline at end of file +{"leaves":["MakeTag","PackageName","SubName","VarNames","functionNoParentheses"],"root":"unitTest"} \ No newline at end of file diff --git a/PowerEditor/src/functionList.xml b/PowerEditor/src/functionList.xml index 129d23a2c..755a5e370 100644 --- a/PowerEditor/src/functionList.xml +++ b/PowerEditor/src/functionList.xml @@ -651,10 +651,8 @@ sub \s+ [A-Za-z_]\w* - \s* - \( - [^()]* - \) + (\s*\([^()]*\))? # prototype or signature + (\s*\:\s*[^{]+)? # attributes \s*\{ # start of class body " >