Enums: Make EnumDefinition use EnumValues instead of Strings as children.

This allows us to store the index of the enum value along the name. The index can be used to compare two enum values in assembler.

Later on this might be used to enable users of KLang to set arbitrary values as the index of an enum value.
This commit is contained in:
2023-03-20 19:30:07 +01:00
parent 77fe360ffa
commit 0594542167
9 changed files with 57 additions and 11 deletions

View File

@@ -5,9 +5,9 @@ import de.hsrm.compiler.Klang.visitors.Visitor;
public class EnumDefinition extends Node {
public String name;
public String[] enums;
public EnumValue[] enums;
public EnumDefinition(String name, String[] enums) {
public EnumDefinition(String name, EnumValue[] enums) {
this.name = name;
this.enums = enums;
}