This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Support for PHP and parse line with STRING text

Tags: None
(comma "," separated)
tomaszn
Registered Member
Posts
3
Karma
0
Hi,

Kdevelop 5.2.2 and earlier have a problem with parsing php code when file contains namespace/variable 'String'.

Code: Select all
<?php
namespace Joomla\String;



or
Code: Select all
public function bind($key = null, &$value = null, $dataType = ParameterType::STRING, $length = 0, $driverOptions = array())


Kdevelop for above example on popup show me:
Code: Select all

Problem in Parser
Expected symbol "bitXorExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "parameterList" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "parameter" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "expr" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "logicalOrExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "logicalXorExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "logicalAndExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "printExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "assignmentExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "conditionalExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "nullCoalesceExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "booleanOrExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "booleanAndExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "bitOrExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "classConstant" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "bitAndExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "equalityExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "relationalExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "shiftExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "additiveExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "multiplicativeExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "unaryExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "unaryExpressionNotPlusminus" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "varExpression" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "varExpressionNormal" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "scalar" (current token: "STRING" [1151] at 277:78 - 277:83)


Problem in Parser
Expected symbol "constantOrClassConst" (current token: "STRING" [1151] at 277:78 - 277:83)


Note: After I change 'STRING' to 'STRINGx' then everything start work again (the coloured code comes back) but it is not a solution.

Please help.
tomaszn
Registered Member
Posts
3
Karma
0
Is there any tutorial how to start contribution?
I suppose there is a bug in kdev-php/parser/php.g but I do not understand such parser language.

Where is the correct place to create a pull request?
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS
Hi,

the .g files are grammar files for the kdev-pg-qt parser generator. You should be able to find some documentation on that on the internet.

Contributions are very welcome! The best place to submit patches is on phabricator.kde.org.

Best,
Sven


I'm working on the KDevelop IDE.
tomaszn
Registered Member
Posts
3
Karma
0
I do not see a solution to fix that.

I only can say that kdevelop shows errors for lines:
Code: Select all
use Joomla\String\StringHelper;
use Joomla\Float\StringHelper;
use Joomla\Int\StringHelper;
use Joomla\Array\StringHelper;
use Joomla\Void\StringHelper;
use Joomla\Bool\StringHelper;
...


but not for:
Code: Select all
use Joomla\Boolean\StringHelper;
use Joomla\Integer\StringHelper;
use Joomla\Yield\StringHelper;


`Void` and `Yield` are mentioned in https://github.com/KDE/kdev-php/blob/ma ... php.g#L241

but `void` is also at:
https://github.com/KDE/kdev-php/blob/16 ... #L911-L922

I do not have enough experience or skills to find out more.


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]