Commit ec289573 authored by Alain Laporte's avatar Alain Laporte Committed by Christoph Cullmann
Browse files

ecma_parser: add space after 'class' and 'function' keywords

* to support case where these keywords are used in parameters or variables
* side effect, anonymous function are no longer detected. But it's not a big deal (and probably better) because without name, it's not very useful to display them
parent 96720b9c
Pipeline #239291 canceled with stage
in 4 minutes and 9 seconds
......@@ -104,7 +104,7 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
current = stripped.at(c);
// look for class definitions (for ActionScript)
if ((current == QLatin1Char('c')) && (stripped.indexOf(QLatin1String("class"), c) == c)) {
if ((current == QLatin1Char('c')) && (stripped.indexOf(QLatin1String("class "), c) == c)) {
identifier.clear();
c += 6;
for (/*c = c*/; c < stripped.length(); c++) {
......@@ -138,7 +138,7 @@ void KatePluginSymbolViewerView::parseEcmaSymbols(void)
} // (look for classes)
// look for function definitions
if ((current == QLatin1Char('f')) && (stripped.indexOf(QLatin1String("function"), c) == c)) {
if ((current == QLatin1Char('f')) && (stripped.indexOf(QLatin1String("function "), c) == c)) {
function_start = c;
c += 8;
// look for the beginning of the parameters
......
......@@ -10,6 +10,12 @@ class Class1 {
function foo1(param1) {
}
function foo2(param1, class_param) {
}
function foo3(param1, function_param) {
}
class Class2 extends Class1 {
constructor(param1, param2) {
super(param1, param2)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment