Bug 370515

Summary: parser thinks PHP7's IIFE syntax is a syntax error. ( immediately invoked function expression )
Product: [Applications] kdevelop Reporter: Hans Henrik Bergan <divinity76>
Component: Language Support: PHPAssignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: divinity76, simonandric5
Priority: NOR    
Version: 5.0.1   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Hans Henrik Bergan 2016-10-12 00:00:01 UTC
as the summary says.
example script:
<?php (function(){})(); ?>

that is valid syntax as of PHP7. errors reported by parser:

Expected symbol "semicolonOrCloseTag" (current token: "(" [1103] at 0:21 - 0:21)

Expected symbol "statement" (current token: "(" [1103] at 0:21 - 0:21)

Expected symbol "topStatement" (current token: "(" [1103] at 0:21 - 0:21)

Expected symbol "outerTopStatement" (current token: "(" [1103] at 0:21 - 0:21)

Expected symbol "start" (current token: "(" [1103] at 0:21 - 0:21)
Comment 1 Milian Wolff 2017-02-02 11:34:41 UTC
Git commit 2bcdaa11f4d37b14cc0e016df9017224ca03f8d4 by Milian Wolff, on behalf of Shashwat Dixit.
Committed on 02/02/2017 at 11:22.
Pushed by mwolff into branch 'master'.

Php7 IIFE syntax parsing

Added parsing support for php7 iife syntax.

Reviewers: kfunk, #kdevelop, mwolff

Reviewed By: #kdevelop, mwolff

Subscribers: kdevelop-devel

Tags: #kdevelop
Differential Revision: https://phabricator.kde.org/D4391

M  +31   -0    duchain/tests/duchain.cpp
M  +2    -0    duchain/tests/duchain.h
M  +6    -2    parser/php.g

https://commits.kde.org/kdev-php/2bcdaa11f4d37b14cc0e016df9017224ca03f8d4
Comment 2 Kevin Funk 2017-03-07 08:47:12 UTC
Git commit deeba5b7af324456278cd78f469c4091abe8bda2 by Kevin Funk, on behalf of Shashwat Dixit.
Committed on 07/03/2017 at 08:41.
Pushed by kfunk into branch '5.1'.

Php7 IIFE syntax parsing

Added parsing support for php7 iife syntax.

Reviewers: kfunk, #kdevelop, mwolff

Reviewed By: #kdevelop, mwolff

Subscribers: kdevelop-devel

Tags: #kdevelop
Differential Revision: https://phabricator.kde.org/D4391

(cherry picked from commit 2bcdaa11f4d37b14cc0e016df9017224ca03f8d4)

M  +31   -0    duchain/tests/duchain.cpp
M  +2    -0    duchain/tests/duchain.h
M  +6    -2    parser/php.g

https://commits.kde.org/kdev-php/deeba5b7af324456278cd78f469c4091abe8bda2