Hello (first time on this list)
Just a question, maybe something I can hack, maybe something somebody else needs to hack?
I have php code that looks like this:
function puctstatus($puctid) { ... }
The 'Symbols' list in the sidebar then lists for me the function name and all is good.
However if my code is like this:
function puctstatus($puctid, $category, $flags) { ..... }
Then the function is not recognised and does not appear in the symbols list.
Is there a file somewhere full of regex type codes that I can edit to modify this or is it all hardcoded in a program somewhere?
Cheers mc
On 14 December 2010 18:23, Murray Collingwood murray@focus-computing.com.au wrote:
Hello (first time on this list)
Just a question, maybe something I can hack, maybe something somebody else needs to hack?
I have php code that looks like this:
function puctstatus($puctid) { ... }
The 'Symbols' list in the sidebar then lists for me the function name and all is good.
However if my code is like this:
function puctstatus($puctid, $category, $flags) { ..... }
Then the function is not recognised and does not appear in the symbols list.
Is there a file somewhere full of regex type codes that I can edit to modify this or is it all hardcoded in a program somewhere?
Yes there is a regex, but its hard coded.
This is it, where ALPHA and ALNUM are the ranges you would expect
"^[ \t]*[(public|protected|private|static|final)[ \t]*]*[ \t]*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\(.*\))"
I'd guess the problem is that \(.*\) matches anything in () after the function name but the regex code only matches against a line at a time and has no way of continuing the match beyond a line.
The only way to go beyond a line seems to be to use a character by character hardcoded parser such as C uses.
In tagmanager/php.c there is a bunch of code that looks like someone started to do it, status unknown.
Cheers Lex
Cheers mc
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Hi Lex
Thanks for your response.
One simple solution would be to drop the trailing bracket from the regex. Do you think this would be an acceptable change?
Cheers Murray
On 14 December 2010 18:34, Lex Trotman elextr@gmail.com wrote:
On 14 December 2010 18:23, Murray Collingwood murray@focus-computing.com.au wrote:
Hello (first time on this list)
Just a question, maybe something I can hack, maybe something somebody
else
needs to hack?
I have php code that looks like this:
function puctstatus($puctid) { ... }
The 'Symbols' list in the sidebar then lists for me the function name and all is good.
However if my code is like this:
function puctstatus($puctid, $category, $flags) { ..... }
Then the function is not recognised and does not appear in the symbols
list.
Is there a file somewhere full of regex type codes that I can edit to
modify
this or is it all hardcoded in a program somewhere?
Yes there is a regex, but its hard coded.
This is it, where ALPHA and ALNUM are the ranges you would expect
"^[ \t]*[(public|protected|private|static|final)[ \t]*]*[ \t]*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\(.*\))"
I'd guess the problem is that \(.*\) matches anything in () after the function name but the regex code only matches against a line at a time and has no way of continuing the match beyond a line.
The only way to go beyond a line seems to be to use a character by character hardcoded parser such as C uses.
In tagmanager/php.c there is a bunch of code that looks like someone started to do it, status unknown.
Cheers Lex
Cheers mc
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On 14 December 2010 21:38, Murray Collingwood murray@focus-computing.com.au wrote:
Hi Lex
Thanks for your response.
One simple solution would be to drop the trailing bracket from the regex. Do you think this would be an acceptable change?
Unfortunately then the parser would not be able to identify the argument list for one line declarations (notice that the \(.*\) is in () as a capture group) and that would mean no arglist, or worse an incorrect arglist, for those declarations that work right at the moment.
Maybe the regex could be changed to \([^)]\)? making the ) optional and if its not there counting all the rest of the line as the arguments. Its not pretty, but at least the function should be recognised.
Anyone else's thoughts?
Cheers Lex
PS I don't know much PHP, but I should note that if a ) can occur anywhere in the declaration then no regex is correct.
Cheers Murray
On 14 December 2010 18:34, Lex Trotman elextr@gmail.com wrote:
On 14 December 2010 18:23, Murray Collingwood murray@focus-computing.com.au wrote:
Hello (first time on this list)
Just a question, maybe something I can hack, maybe something somebody else needs to hack?
I have php code that looks like this:
function puctstatus($puctid) { ... }
The 'Symbols' list in the sidebar then lists for me the function name and all is good.
However if my code is like this:
function puctstatus($puctid, $category, $flags) { ..... }
Then the function is not recognised and does not appear in the symbols list.
Is there a file somewhere full of regex type codes that I can edit to modify this or is it all hardcoded in a program somewhere?
Yes there is a regex, but its hard coded.
This is it, where ALPHA and ALNUM are the ranges you would expect
"^[ \t]*[(public|protected|private|static|final)[ \t]*]*[ \t]*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\(.*\))"
I'd guess the problem is that \(.*\) matches anything in () after the function name but the regex code only matches against a line at a time and has no way of continuing the match beyond a line.
The only way to go beyond a line seems to be to use a character by character hardcoded parser such as C uses.
In tagmanager/php.c there is a bunch of code that looks like someone started to do it, status unknown.
Cheers Lex
Cheers mc
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Le 14/12/2010 11:58, Lex Trotman a écrit :
On 14 December 2010 21:38, Murray Collingwood murray@focus-computing.com.au wrote:
Hi Lex
Thanks for your response.
One simple solution would be to drop the trailing bracket from the regex. Do you think this would be an acceptable change?
Unfortunately then the parser would not be able to identify the argument list for one line declarations (notice that the \(.*\) is in () as a capture group) and that would mean no arglist, or worse an incorrect arglist, for those declarations that work right at the moment.
Maybe the regex could be changed to \([^)]\)? making the ) optional and if its not there counting all the rest of the line as the arguments. Its not pretty, but at least the function should be recognised.
Anyone else's thoughts?
Cheers Lex
PS I don't know much PHP, but I should note that if a ) can occur anywhere in the declaration then no regex is correct.
Yeah, declarations can be like this to describe optionnal arguments and their default values :
function foo($arg1, $arg2 = array('random', 'stuff'), $arg3 = 'bar') { // ... }
Hope im clear enough ...
Cheers Murray
On 14 December 2010 18:34, Lex Trotmanelextr@gmail.com wrote:
On 14 December 2010 18:23, Murray Collingwood murray@focus-computing.com.au wrote:
Hello (first time on this list)
Just a question, maybe something I can hack, maybe something somebody else needs to hack?
I have php code that looks like this:
function puctstatus($puctid) { ... }
The 'Symbols' list in the sidebar then lists for me the function name and all is good.
However if my code is like this:
function puctstatus($puctid, $category, $flags) { ..... }
Then the function is not recognised and does not appear in the symbols list.
Is there a file somewhere full of regex type codes that I can edit to modify this or is it all hardcoded in a program somewhere?
Yes there is a regex, but its hard coded.
This is it, where ALPHA and ALNUM are the ranges you would expect
"^[ \t]*[(public|protected|private|static|final)[ \t]*]*[ \t]*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\(.*\))"
I'd guess the problem is that \(.*\) matches anything in () after the function name but the regex code only matches against a line at a time and has no way of continuing the match beyond a line.
The only way to go beyond a line seems to be to use a character by character hardcoded parser such as C uses.
In tagmanager/php.c there is a bunch of code that looks like someone started to do it, status unknown.
Cheers Lex
Cheers mc
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
On 14 December 2010 22:03, Etienne MELEARD etienne.meleard@cru.fr wrote:
Le 14/12/2010 11:58, Lex Trotman a écrit :
On 14 December 2010 21:38, Murray Collingwood murray@focus-computing.com.au wrote:
Hi Lex
Thanks for your response.
One simple solution would be to drop the trailing bracket from the regex. Do you think this would be an acceptable change?
Unfortunately then the parser would not be able to identify the argument list for one line declarations (notice that the \(.*\) is in () as a capture group) and that would mean no arglist, or worse an incorrect arglist, for those declarations that work right at the moment.
Maybe the regex could be changed to \([^)]\)? making the ) optional and if its not there counting all the rest of the line as the arguments. Its not pretty, but at least the function should be recognised.
Anyone else's thoughts?
Cheers Lex
PS I don't know much PHP, but I should note that if a ) can occur anywhere in the declaration then no regex is correct.
Yeah, declarations can be like this to describe optionnal arguments and their default values :
function foo($arg1, $arg2 = array('random', 'stuff'), $arg3 = 'bar') { // ... }
Hope im clear enough ...
Thanks, clearly nested brackets and multiline declarations are beyond the regex system. It needs someone with C and PHP capability to create a proper parser similar to the one used for C.
Cheers Lex
Cheers Murray
On 14 December 2010 18:34, Lex Trotmanelextr@gmail.com wrote:
On 14 December 2010 18:23, Murray Collingwood murray@focus-computing.com.au wrote:
Hello (first time on this list)
Just a question, maybe something I can hack, maybe something somebody else needs to hack?
I have php code that looks like this:
function puctstatus($puctid) { ... }
The 'Symbols' list in the sidebar then lists for me the function name and all is good.
However if my code is like this:
function puctstatus($puctid, $category, $flags) { ..... }
Then the function is not recognised and does not appear in the symbols list.
Is there a file somewhere full of regex type codes that I can edit to modify this or is it all hardcoded in a program somewhere?
Yes there is a regex, but its hard coded.
This is it, where ALPHA and ALNUM are the ranges you would expect
"^[ \t]*[(public|protected|private|static|final)[ \t]*]*[ \t]*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\(.*\))"
I'd guess the problem is that \(.*\) matches anything in () after the function name but the regex code only matches against a line at a time and has no way of continuing the match beyond a line.
The only way to go beyond a line seems to be to use a character by character hardcoded parser such as C uses.
In tagmanager/php.c there is a bunch of code that looks like someone started to do it, status unknown.
Cheers Lex
Cheers mc
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Hi guys
I see your point - in the meantime I'm coding this way:
function abc($parm, // ) $p2, $p3) { ... }
This solves my immediate problem (having function names appear in the Symbols list).
Cheers mc
On 14 December 2010 22:39, Lex Trotman elextr@gmail.com wrote:
On 14 December 2010 22:03, Etienne MELEARD etienne.meleard@cru.fr wrote:
Le 14/12/2010 11:58, Lex Trotman a écrit :
On 14 December 2010 21:38, Murray Collingwood murray@focus-computing.com.au wrote:
Hi Lex
Thanks for your response.
One simple solution would be to drop the trailing bracket from the
regex.
Do you think this would be an acceptable change?
Unfortunately then the parser would not be able to identify the argument list for one line declarations (notice that the \(.*\) is in () as a capture group) and that would mean no arglist, or worse an incorrect arglist, for those declarations that work right at the moment.
Maybe the regex could be changed to \([^)]\)? making the ) optional and if its not there counting all the rest of the line as the arguments. Its not pretty, but at least the function should be recognised.
Anyone else's thoughts?
Cheers Lex
PS I don't know much PHP, but I should note that if a ) can occur anywhere in the declaration then no regex is correct.
Yeah, declarations can be like this to describe optionnal arguments and their default values :
function foo($arg1, $arg2 = array('random', 'stuff'), $arg3 = 'bar') { // ... }
Hope im clear enough ...
Thanks, clearly nested brackets and multiline declarations are beyond the regex system. It needs someone with C and PHP capability to create a proper parser similar to the one used for C.
Cheers Lex
Cheers Murray
On 14 December 2010 18:34, Lex Trotmanelextr@gmail.com wrote:
On 14 December 2010 18:23, Murray Collingwood murray@focus-computing.com.au wrote:
Hello (first time on this list)
Just a question, maybe something I can hack, maybe something somebody else needs to hack?
I have php code that looks like this:
function puctstatus($puctid) { ... }
The 'Symbols' list in the sidebar then lists for me the function name and all is good.
However if my code is like this:
function puctstatus($puctid, $category, $flags) { ..... }
Then the function is not recognised and does not appear in the
symbols
list.
Is there a file somewhere full of regex type codes that I can edit to modify this or is it all hardcoded in a program somewhere?
Yes there is a regex, but its hard coded.
This is it, where ALPHA and ALNUM are the ranges you would expect
"^[ \t]*[(public|protected|private|static|final)[ \t]*]*[ \t]*function[ \t]+&?[ \t]*([" ALPHA "_][" ALNUM "_]*)[[:space:]]*(\(.*\))"
I'd guess the problem is that \(.*\) matches anything in () after the function name but the regex code only matches against a line at a time and has no way of continuing the match beyond a line.
The only way to go beyond a line seems to be to use a character by character hardcoded parser such as C uses.
In tagmanager/php.c there is a bunch of code that looks like someone started to do it, status unknown.
Cheers Lex
Cheers mc
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
-- Murray Collingwood Focus Computing p +61 415 24 26 24 http://www.focus-computing.com.au
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Geany mailing list Geany@uvena.de http://lists.uvena.de/cgi-bin/mailman/listinfo/geany
Dnia wtorek, 14 grudnia 2010 o 13:39:46 Lex Trotman napisał(a):
On 14 December 2010 22:03, Etienne MELEARD etienne.meleard@cru.fr wrote:
Yeah, declarations can be like this to describe optionnal arguments and their default values :
function foo($arg1, $arg2 = array('random', 'stuff'), $arg3 = 'bar') { // ... }
Hope im clear enough ...
Thanks, clearly nested brackets and multiline declarations are beyond the regex system. It needs someone with C and PHP capability to create a proper parser similar to the one used for C.
Rather, to use the PHP tokeniser — requires PHP itself.
Cheers, Chris
2010/12/16 Krzysztof Żelechowski giecrilj@stegny.2a.pl:
Dnia wtorek, 14 grudnia 2010 o 13:39:46 Lex Trotman napisał(a):
On 14 December 2010 22:03, Etienne MELEARD etienne.meleard@cru.fr wrote:
Yeah, declarations can be like this to describe optionnal arguments and their default values :
function foo($arg1, $arg2 = array('random', 'stuff'), $arg3 = 'bar') { // ... }
Hope im clear enough ...
Thanks, clearly nested brackets and multiline declarations are beyond the regex system. It needs someone with C and PHP capability to create a proper parser similar to the one used for C.
Rather, to use the PHP tokeniser -- requires PHP itself.
Unfortunately the tagmanager (the software used by Geany is frm another project) doesn't allow for any sort of "plugin" parsing other than the regexes so using the PHP tokeniser could be quite complex.
Cheers Lex
Cheers, Chris
Dnia poniedziałek, 20 grudnia 2010 o 07:58:44 Lex Trotman napisał(a):
2010/12/16 Krzysztof Żelechowski giecrilj@stegny.2a.pl:
Dnia wtorek, 14 grudnia 2010 o 13:39:46 Lex Trotman napisał(a):
On 14 December 2010 22:03, Etienne MELEARD etienne.meleard@cru.fr wrote:
Yeah, declarations can be like this to describe optionnal arguments and their default values :
function foo($arg1, $arg2 = array('random', 'stuff'), $arg3 = 'bar') { // ... }
Hope im clear enough ...
Thanks, clearly nested brackets and multiline declarations are beyond the regex system. It needs someone with C and PHP capability to create a proper parser similar to the one used for C.
Rather, to use the PHP tokeniser -- requires PHP itself.
Unfortunately the tagmanager (the software used by Geany is frm another project) doesn't allow for any sort of "plugin" parsing other than the regexes so using the PHP tokeniser could be quite complex.
Assuming that Geany can use a "proper parser" for PHP, which means executable code rather then regex-based, you can make the parser delegate the hard work to the tokeniser provided by PHP. Problem solved?
Cheers, Chris
2010/12/20 Krzysztof Żelechowski giecrilj@stegny.2a.pl:
Dnia poniedziałek, 20 grudnia 2010 o 07:58:44 Lex Trotman napisał(a):
2010/12/16 Krzysztof Żelechowski giecrilj@stegny.2a.pl:
Dnia wtorek, 14 grudnia 2010 o 13:39:46 Lex Trotman napisał(a):
On 14 December 2010 22:03, Etienne MELEARD etienne.meleard@cru.fr wrote:
Yeah, declarations can be like this to describe optionnal arguments and their default values :
function foo($arg1, $arg2 = array('random', 'stuff'), $arg3 = 'bar') { // ... }
Hope im clear enough ...
Thanks, clearly nested brackets and multiline declarations are beyond the regex system. It needs someone with C and PHP capability to create a proper parser similar to the one used for C.
Rather, to use the PHP tokeniser -- requires PHP itself.
Unfortunately the tagmanager (the software used by Geany is frm another project) doesn't allow for any sort of "plugin" parsing other than the regexes so using the PHP tokeniser could be quite complex.
Assuming that Geany can use a "proper parser" for PHP, which means executable code rather then regex-based, you can make the parser delegate the hard work to the tokeniser provided by PHP. Problem solved?
Ok, patches welcome
Cheers Lex
Cheers, Chris
On Mon, 20 Dec 2010 21:58:20 +1100 Lex Trotman elextr@gmail.com wrote:
2010/12/20 Krzysztof Żelechowski giecrilj@stegny.2a.pl:
Dnia poniedziałek, 20 grudnia 2010 o 07:58:44 Lex Trotman napisał(a):
2010/12/16 Krzysztof Żelechowski giecrilj@stegny.2a.pl:
Dnia wtorek, 14 grudnia 2010 o 13:39:46 Lex Trotman napisał(a):
On 14 December 2010 22:03, Etienne MELEARD etienne.meleard@cru.fr wrote:
Yeah, declarations can be like this to describe optionnal arguments and their default values :
function foo($arg1, $arg2 = array('random', 'stuff'), $arg3 = 'bar') { // ... }
Hope im clear enough ...
Thanks, clearly nested brackets and multiline declarations are beyond the regex system. It needs someone with C and PHP capability to create a proper parser similar to the one used for C.
Rather, to use the PHP tokeniser -- requires PHP itself.
Unfortunately the tagmanager (the software used by Geany is frm another project) doesn't allow for any sort of "plugin" parsing other than the regexes so using the PHP tokeniser could be quite complex.
Assuming that Geany can use a "proper parser" for PHP, which means executable code rather then regex-based, you can make the parser delegate the hard work to the tokeniser provided by PHP. Problem solved?
Ok, patches welcome
Yepp, as always ;)
Cheers, Frank