Add support for Generators.
ClosedPublic

Authored by pprkut on Jun 17 2018, 12:41 PM.

Details

Summary

This adds support for generators and generator delegation
according to:

Diff Detail

Repository
R52 KDevelop: PHP Support
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
pprkut created this revision.Jun 17 2018, 12:41 PM
Restricted Application added a project: KDevelop. · View Herald TranscriptJun 17 2018, 12:41 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
pprkut requested review of this revision.Jun 17 2018, 12:41 PM
zhigalin accepted this revision as: zhigalin.Jul 29 2018, 1:09 AM
zhigalin removed a reviewer: KDevelop.
zhigalin added subscribers: brauch, kfunk, mwolff, zhigalin.

Hello.
Sorry for the late reply, I haven't noticed when this review was created

This adds support for generators and generator delegation

This is great, with this patch the [T6816: PHP 5.5 features] will be fully supported!
The path looks good to me.

P.S. the KDE admins have deliberately decided to remove projects from reviewers and leave only mailing list as subscription so you shouldn't add them manually.

If you want to attract attention simply write ping in the comments.
Fell free to do it more frequently, it have been here for more than 1 month and I totally missed it.

/CC @mwolff @kfunk @brauch

parser/phplexer.cpp
810–811

This smells like spaghetti, are you sure? how about something like

auto nextToken = QString();
nextToken += *   lookAhead;
nextToken += * ++lookAhead;
nextToken += * ++lookAhead;
nextToken += * ++lookAhead;
if (pos + 1 < m_contentSize && nextToken == QStringLiteral("from")) {

(example code, not sure it will work)

This revision is now accepted and ready to land.Jul 29 2018, 1:09 AM

I rebased this against master and found it has the same problem as D13547, i.e. it introduces 10 first/follow conflicts :/
Not sure it's worth trying to solve it here either.

If you want to attract attention simply write ping in the comments.
Fell free to do it more frequently, it have been here for more than 1 month and I totally missed it.

I merely saw that mine are the only reviews that miss it, so I added it. I'll use pings in the future :)

I rebased this against master and found it has the same problem as D13547, i.e. it introduces 10 first/follow conflicts :/
Not sure it's worth trying to solve it here either.

I think we have more pressing issues like namespaces handling which makes KDevelop hard to use with any of PHP frameworks.
I would opt to complete PHP 5.5 support at least...

pprkut updated this revision to Diff 38970.Aug 2 2018, 6:31 PM

Less spaghetti in the lexer.

pprkut marked an inline comment as done.Aug 2 2018, 6:33 PM
pprkut added inline comments.
parser/phplexer.cpp
810–811

Minor adjustments, but it seems to work. Thanks! :)

This revision was automatically updated to reflect the committed changes.