Hi, Anybody working on improving PHP parser in tagmanager? If not, I intend to have a look at it this weekend. Primary objective is to add calltips. I could use some example code or any other pointer about regex callbacks in ctags (other than the sample in ctags). bye.
On Thu, Mar 4, 2010 at 14:28, Can Koy cankoy@ymail.com wrote:
Hi, Anybody working on improving PHP parser in tagmanager? If not, I intend to have a look at it this weekend. Primary objective is to add calltips. I could use some example code or any other pointer about regex callbacks in ctags (other than the sample in ctags).
If you could give the PHP parser some love, it would be most welcome! I've updated the regexes a few times in the past, but I'm just a PHP programmer/scripter who doesn't understand anything of C.
Primary objective is to add calltips.
Does this mean that Geany will be able to display paramaters for user defined functions? That would be awesome!!!
I have a few other items on my wishlist, if you're interested: * On-the-fly symbol detection (it requires a save action now) * Add variable names delared in function calls: function my_func($var1 = test, $var2) { }. * Add variable names declared in a list: list($var1, $var2) = $array; * Add variable names delared in a function callback: if ($var1 = my_func()) { }
Unfortunately, I'm unavailable this weekend due to the fact I've been born 30 years before that, so I'm not able to test anything until Tuesday/Wednesday...
Good luck and thank you very much! \o/
-H-
----- Original Message ----
From: Harold Aling geany@sait.nl To: Geany development list geany-devel@uvena.de Sent: Thu, March 4, 2010 4:04:15 PM Subject: Re: [Geany-devel] Improving PHP parser
On Thu, Mar 4, 2010 at 14:28, Can Koy wrote:
Hi, Anybody working on improving PHP parser in tagmanager? If not, I intend to have a look at it this weekend. Primary objective is to
add calltips.
I could use some example code or any other pointer about regex callbacks in
ctags (other than the sample in ctags).
If you could give the PHP parser some love, it would be most welcome!
Honestly, it needs more than love, like a big slap. It's quite in bad shape.
I have a few other items on my wishlist, if you're interested:
- On-the-fly symbol detection (it requires a save action now)
- Add variable names delared in function calls: function my_func($var1
= test, $var2) { }.
- Add variable names declared in a list: list($var1, $var2) = $array;
- Add variable names delared in a function callback: if ($var1 = my_func()) { }
I think 'nested scopes' is very much needed, the single flat scope holding names is dreadful. But it looks hard to implement. I reckon 'calltips' is a good start. Some of your wishes *may* be covered on the way. And before set out, I could use any leverage on regex callbacks in ctags, please let me know if you (or anyone reading this) have access to such resource. So far, it seems I'll be the first to make use of that ctags feature (openly, at least). Btw, happy birthday! It's been some time since my 30th.
Unfortunately, I'm unavailable this weekend due to the fact I've been born 30 years before that, so I'm not able to test anything until Tuesday/Wednesday...
Good luck and thank you very much! \o/
-H-
On Thu, 4 Mar 2010 05:28:32 -0800 (PST) Can Koy cankoy@ymail.com wrote:
Anybody working on improving PHP parser in tagmanager? If not, I intend to have a look at it this weekend. Primary objective is to add calltips. I could use some example code or any other pointer about regex callbacks in ctags (other than the sample in ctags).
I haven't used callbacks but I suspect you will need to use a full parser, i.e. like the #if 0 part. As I don't use PHP myself I can't remember what issue there was with the parser, but I never liked the ctags regex 'solution'.
For calltips see the python.c file - parseArglist().
Regards, Nick
On Fri, 5 Mar 2010 16:50:42 +0000, Nick wrote:
On Thu, 4 Mar 2010 05:28:32 -0800 (PST) Can Koy cankoy@ymail.com wrote:
Anybody working on improving PHP parser in tagmanager? If not, I intend to have a look at it this weekend. Primary objective is to add calltips. I could use some example code or any other pointer about regex callbacks in ctags (other than the sample in ctags).
I haven't used callbacks but I suspect you will need to use a full parser, i.e. like the #if 0 part. As I don't use PHP myself I can't remember what issue there was with the parser, but I never liked the
IIRC the old, 'real' parser which is currently if 0'ed had problems with PHP5. Can, if you like to improve it, I guess tons of users would highly appreciated that as Harold already said. And I think it's worth reviving the if 0'ed code and make it work with PHP5 and then add the mentioned features. The regex code basically works but as you all know it has quite some serious limitations. PHP is just too complex to be parsed with a few line-based regular expressions.
I personally have the same problem as Nick, I'm not a PHP guy :).
Regards, Enrico
--- On Sun, 3/7/10, Enrico Tröger enrico.troeger@uvena.de wrote:
From: Enrico Tröger enrico.troeger@uvena.de Subject: Re: [Geany-devel] Improving PHP parser To: geany-devel@uvena.de Date: Sunday, March 7, 2010, 3:54 PM On Fri, 5 Mar 2010 16:50:42 +0000, Nick wrote:
On Thu, 4 Mar 2010 05:28:32 -0800 (PST) Can Koy cankoy@ymail.com
wrote:
Anybody working on improving PHP parser in tagmanager? If not, I intend to have a look at it this weekend. Primary objective is to add calltips. I could use some example code or any other pointer about regex callbacks in ctags (other than the sample in ctags).
I haven't used callbacks but I suspect you will need to use a full parser, i.e. like the #if 0 part. As I don't use PHP myself I can't remember what issue there was with the parser, but I never liked the
IIRC the old, 'real' parser which is currently if 0'ed had problems with PHP5. Can, if you like to improve it, I guess tons of users would highly appreciated that as Harold already said. And I think it's worth reviving the if 0'ed code and make it work with PHP5 and then add the mentioned features. The regex code basically works but as you all know it has quite some serious limitations. PHP is just too complex to be parsed with a few line-based regular expressions.
The default regex parser only creates names in a tag, but with callbacks this behaviour is extensible. I have no intention to revert to manual parsing.
--