mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-05-28 20:44:55 +00:00
[] and () separated
This commit is contained in:
@@ -121,7 +121,7 @@ public class ActionScript3SimpleParser implements SimpleParser {
|
||||
break;
|
||||
case PARENT_OPEN:
|
||||
call(errors, thisType, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, isStatic, variables, abc);
|
||||
lastVarName += "()";
|
||||
lastVarName += ".()";
|
||||
ret = true;
|
||||
break;
|
||||
case DESCENDANTS:
|
||||
@@ -215,7 +215,7 @@ public class ActionScript3SimpleParser implements SimpleParser {
|
||||
ret = true;
|
||||
s = lex();
|
||||
} else if (s.type == SymbolType.BRACKET_OPEN) {
|
||||
lastVarName += "[]";
|
||||
lastVarName += ".[]";
|
||||
expression(errors, thisType, needsActivation, importedClasses, openedNamespaces, registerVars, inFunction, inMethod, isStatic, true, variables, false, abc);
|
||||
expectedType(errors, SymbolType.BRACKET_CLOSE);
|
||||
ret = true;
|
||||
|
||||
@@ -61,11 +61,7 @@ public class Variable implements VariableOrScope {
|
||||
String ret = name;
|
||||
if (ret.contains(".")) {
|
||||
ret = ret.substring(ret.lastIndexOf(".") + 1);
|
||||
}
|
||||
|
||||
if (ret.endsWith("()") || ret.endsWith("[]")) {
|
||||
ret = ret.substring(0, ret.length() - 2);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -73,21 +69,10 @@ public class Variable implements VariableOrScope {
|
||||
String ret = name;
|
||||
if (ret.contains(".")) {
|
||||
ret = ret.substring(0, ret.indexOf("."));
|
||||
}
|
||||
if (ret.endsWith("()") || ret.endsWith("[]")) {
|
||||
ret = ret.substring(0, ret.length() - 2);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public boolean firstNameIsCall() {
|
||||
String ret = name;
|
||||
if (ret.contains(".")) {
|
||||
ret = ret.substring(0, ret.indexOf("."));
|
||||
}
|
||||
return ret.endsWith("()");
|
||||
}
|
||||
|
||||
|
||||
public String getParentName() {
|
||||
if (name.contains(".")) {
|
||||
return name.substring(0, name.lastIndexOf("."));
|
||||
@@ -96,24 +81,10 @@ public class Variable implements VariableOrScope {
|
||||
}
|
||||
|
||||
public List<String> getParts() {
|
||||
List<String> ret = new ArrayList<>();
|
||||
|
||||
String[] dotSplit = name.split("\\.", -1);
|
||||
Pattern pat = Pattern.compile("[^\\(\\)\\[\\]]+|\\(\\)|\\[\\]");
|
||||
for (String s : dotSplit) {
|
||||
Matcher m = pat.matcher(s);
|
||||
while (m.find()) {
|
||||
ret.add(m.group());
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
return Arrays.asList(name.split("\\.", -1));
|
||||
}
|
||||
|
||||
public boolean hasParent() {
|
||||
return name.contains(".");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String v = "v.getPoint().x";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user