But UltraEdit still has problems with functions with default values
- Code: Select all
public function test($abc = array());
OR
- Code: Select all
private function test2($def = 'no');
Has anyone a fixed wordfile function section for this problem
Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.
public function test($abc = array());private function test2($def = 'no');
/TGBegin "Function"
/TGFindStr = "%[^t ]++function[^t ]+^([a-ÿ0-9_&]+^)"
/TGFindStr = "%[^t ]++static[^t ]+function[^t ]+^([a-ÿ0-9_&]+^)"
/TGFindStr = "%[^t ]++function[^t ]+^([~{]+^)"
/TGFindStr = "%[^t ]++[publicrotecdvas ]++[^t ]++function[^t ]+^([a-ÿ0-9_&]+^)"
/TGEnd/Function String = "%[^t ]++function[^t ]+^([a-ÿ0-9_&]+^)"
/Function String 1 = "%[^t ]++static[^t ]+function[^t ]+^([a-ÿ0-9_&]+^)"
/Function String 2 = "%[^t ]++function[^t ]+^([~{]+^)"
/Function String 3 = "%[^t ]++[publicrotecdvas ]++[^t ]++function[^t ]+^([a-ÿ0-9_&]+^)"
[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*PHP Manual wrote:A valid function name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: [a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*.
function
public static function
static function
public function
protected function
private function/TGBegin "Function"
/TGFindStr = "%[^t ]++[publicrotecdvas ]++[^t ]++function[^t ]+^([a-ÿ0-9_&]+^)"
/TGBegin "Parameter"
/TGFindStr = "[ ^t^p]++^([~,]+^)"
/TGFindBStart = "("
/TGFindBEnd = ")"
/TGBegin "Variable"
/TGFindStr = "%[ ^t]++^(^$[a-z_0-9]+^)[ ^t]++=*;"
/TGFindBStart = "{"
/TGFindBEnd = "}"
/TGEnd
/TGEnd
/TGEnd
// function My_PHP_Function_01() {}
/* function My_PHP_Function_02() {} *//* Block comment starts here
function My_PHP_Function_03() {}
Block comment ends here. */function My_PHP_Function_01()
{
}


Mofi wrote:@rhapdog
IDM introduced with UE v16.00 and UES v10.00 the hierarchical function list with unlimited regular expressions. With such a version the function strings can be configured directly in UE/UES using a dialog. It is not necessary to open the wordfile and edit the regular expressions.....

/TGBegin "Function"
/TGFindStr = "%[^t ]++function[^t^p ]+^([a-z_-ÿ][a-z0-9_-ÿ]++^)[^t^p ]++("
/TGFindStr = "%[^t ]++[afps][birtu][abinos][altv][aeilr][^t act][a-filnopr-v ^t]++function[^t^p ]+^([a-z_-ÿ][a-z0-9_-ÿ]++^)[^t^p ]++("
/TGBegin "Parameter"
/TGFindStr = "[^t ^p]++^([~,]+^)"
/TGFindBStart = "("
/TGFindBEnd = ")"
/TGEnd
/TGBegin "Variable"
/TGFindStr = "%[^t ]++^(^$[a-z_-ÿ][a-z0-9_-ÿ]++^)[^t ]++=*;"
/TGFindBStart = "{"
/TGFindBEnd = "}"
/TGEnd
/TGEnd/TGBegin "Parameter"
/TGFindStr = "[^t ^p]++^(^$[~,()]+(*)^)"
/TGFindBStart = "("
/TGFindBEnd = ")"
/TGFindStr = "[^t ^p]++^([~,]+^)"
/TGFindBStart = "("
/TGFindBEnd = ")"
/TGEndphpArguments_11
Parameter
$foo = array(1,2,3,4)
$foo = array(1
2
3
4)
phpArguments_12
Parameter
$foo = array('test' => 5, 'hello', 'foo' => "hehe")
$foo = array('test' => 5
'hello'
'foo' => "hehe")/Function String = "%[^t ]++function[^t^p ]+^([a-z_-ÿ][a-z0-9_-ÿ]++[^t^p ]++([~)]++)^)"
/Function String 1 = "%[^t ]++[afps][birtu][abinos][altv][aeilr][^t act][a-filnopr-v ^t]++function[^t^p ]+^([a-z_-ÿ][a-z0-9_-ÿ]++[^t^p ]++([~)]++)^)"/Function String = "%[^t ]++function[^t^p ]+^([a-z_-ÿ][a-z0-9_-ÿ]++[^t^p ]++([~{]+^)"
/Function String 1 = "%[^t ]++[afps][birtu][abinos][altv][aeilr][^t act][a-filnopr-v ^t]++function[^t^p ]+^([a-z_-ÿ][a-z0-9_-ÿ]++[^t^p ]++([~{]+^)"
function myFunc($element, $options = array()) {
$default = array(
'type' => 5,
'reverse' => false, // commas at the end are also possible but uncommon
);
$options = array_merge($default, $options);
}function specialExplode($string, $delim = ",") {
}darkdragon-001 wrote:In PHP (or at least the CakePHP framework) it's very common to use few parameter and instead use an $options array like follows ... So I think the empty array shoulld be recognized correctly! Further, multidimensional array declarations as default values are very rare.
darkdragon-001 wrote:PHP has one great advantage towards other programming languages in terms of recognition:
All variables MUST start with a dollar sign $! I think we should use this somehow.
darkdragon-001 wrote:For many users it would be good at least match the parameters without default declarations correctly and omit the default values completely (it also takes less space to display -> this is something to take into account for the flat lists where the parameters are not listed one under each other).
darkdragon-001 wrote:Is it possible to set /TGFindBEnd = ")[^t ]{"?
function specialExplode2($string, $delim = ")", $lineTerm) {
}darkdragon-001 wrote:The flat lists you provided do no longer match functions My_PHP_Function_04() to My_PHP_Function_21() -> those with keywords before function.

Mofi wrote:About functions within a block comment:
Using the following function definitions results in a quite good hierarchical function list.
- Code: Select all
...
/TGBegin "Function"
/TGFindStr = "%[^t ]++function[^t^p ]+^([a-z_-ÿ][a-z0-9_-ÿ]++^)[^t^p ]++("
/TGFindStr = "%[^t ]++[afps][birtu][abinos][altv][aeilr][^t act][a-filnopr-v ^t]++function[^t^p ]+^([a-z_-ÿ][a-z0-9_-ÿ]++^)[^t^p ]++("
/TGBegin "Parameter"
/TGFindStr = "[^t ^p]++^([~,]+^)"
/TGFindBStart = "("
/TGFindBEnd = ")"
/TGEnd
/TGBegin "Variable"
/TGFindStr = "%[^t ]++^(^$[a-z_-ÿ][a-z0-9_-ÿ]++^)[^t ]++=*;"
/TGFindBStart = "{"
/TGFindBEnd = "}"
/TGEnd
/TGEnd
...
However, what can we do to improve the function list view result for those functions with initialized arrays. Well, we can add additional regular expressions to subgroup Parameter like following:
- Code: Select all
/TGBegin "Parameter"
/TGFindStr = "[^t ^p]++^(^$[~,()]+(*)^)"
/TGFindBStart = "("
/TGFindBEnd = ")"
/TGFindStr = "[^t ^p]++^([~,]+^)"
/TGFindBStart = "("
/TGFindBEnd = ")"
/TGEnd
Now simple initialized arrays are displayed at least also complete in the function list view additional to the wrong parameter list. For example phpArguments_11 and phpArguments_12
- Code: Select all
phpArguments_11
Parameter
$foo = array(1,2,3,4)
$foo = array(1
2
3
4)
phpArguments_12
Parameter
$foo = array('test' => 5, 'hello', 'foo' => "hehe")
$foo = array('test' => 5
'hello'
'foo' => "hehe")
$foo = array(1,2,3,4)
$foo = array(1
2
3
4)
phpArguments_11
$foo = array('test' => 5, 'hello', 'foo' => "hehe")
$foo = array('test' => 5
'hello'
'foo' => "hehe")
phpArguments_12Mofi wrote:@rhapdog
...
The regular expressions of top level groups are usually UltraEdit regular expressions, but can be also Perl regular expressions if manually adding /Regexp Type = Perl to the wordfile. Unfortunately the regular expressions of subgroups are always executed with the UltraEdit regular expression engine. I have reported this issue to IDM support by email long time ago and I have not checked since this report if the IDM developers have changed something regarding this issue.
