Endabgabe #20

Merged
i22035 merged 137 commits from Endabgabe into main 2024-07-05 11:59:47 +00:00
Showing only changes of commit d925a3258c - Show all commits

View File

@ -253,6 +253,7 @@ public class SemanticAnalyzer implements SemanticVisitor {
if (toCheck.memberAccess != null) { if (toCheck.memberAccess != null) {
var result = toCheck.memberAccess.accept(this); var result = toCheck.memberAccess.accept(this);
toCheck.identifier = toCheck.memberAccess.identifiers.getLast();
toCheck.setTypeNode(result.getType()); toCheck.setTypeNode(result.getType());
return result; return result;
} else { } else {
@ -608,11 +609,15 @@ public class SemanticAnalyzer implements SemanticVisitor {
ITypeNode currentType = null; ITypeNode currentType = null;
int start = 0; int start = 0;
if(!memberAccessNode.identifiers.isEmpty()){ if(!memberAccessNode.identifiers.isEmpty()){
if(currentFields.get(memberAccessNode.identifiers.get(0)) != null){ if(currentFields.get(memberAccessNode.identifiers.getFirst()) != null){
memberAccessNode.identifiers.add(0, currentClass.identifier); memberAccessNode.identifiers.addFirst(currentClass.identifier);
start = 1; start++;
} }
} }
if(context.getClasses().get(memberAccessNode.identifiers.getFirst()) != null){
memberAccessNode.identifiers.addFirst(currentClass.identifier);
start++;
}
for (int i = start; i < memberAccessNode.identifiers.size(); i++) { for (int i = start; i < memberAccessNode.identifiers.size(); i++) {
String s = memberAccessNode.identifiers.get(i); String s = memberAccessNode.identifiers.get(i);