Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
49343dbd
Commit
49343dbd
authored
Jul 22, 2022
by
Alain Laporte
Committed by
Christoph Cullmann
Jul 25, 2022
Browse files
php_parser: fix wrong argument parsing
We must use a global match to parse all arguments
parent
44bb786a
Pipeline
#208956
passed with stage
in 6 minutes and 28 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
addons/symbolviewer/php_parser.cpp
View file @
49343dbd
...
...
@@ -85,7 +85,8 @@ void KatePluginSymbolViewerView::parsePhpSymbols(void)
// remove useless comments: “public/* static */ function a($b, $c=null) /* test */” => “public function a($b, $c=null)”
static
const
QRegularExpression
blockCommentInline
(
QLatin1String
(
"/
\\
*.*
\\
*/"
),
QRegularExpression
::
InvertedGreedinessOption
);
QRegularExpressionMatch
match
,
matchClass
,
matchInterface
,
matchFunctionArgs
;
QRegularExpressionMatch
match
,
matchClass
,
matchInterface
,
matchFunctionArg
;
QRegularExpressionMatchIterator
matchFunctionArgs
;
int
i
,
pos
;
bool
inBlockComment
=
false
;
...
...
@@ -259,8 +260,12 @@ void KatePluginSymbolViewerView::parsePhpSymbols(void)
}
QString
functionArgs
(
match
.
captured
(
6
));
matchFunctionArgs
=
functionArgsRegExp
.
match
(
functionArgs
);
functionArgsList
=
matchFunctionArgs
.
capturedTexts
();
functionArgsList
.
clear
();
matchFunctionArgs
=
functionArgsRegExp
.
globalMatch
(
functionArgs
);
while
(
matchFunctionArgs
.
hasNext
())
{
matchFunctionArg
=
matchFunctionArgs
.
next
();
functionArgsList
.
append
(
matchFunctionArg
.
captured
(
0
));
}
nameWithTypes
=
match
.
captured
(
5
)
+
QLatin1Char
(
'('
)
+
functionArgsList
.
join
(
QLatin1String
(
", "
))
+
QLatin1Char
(
')'
);
if
(
m_typesOn
->
isChecked
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment