Skip to content

Add unions and enums. #4

@Dich0tomy

Description

@Dich0tomy

Status

Unions and enums parse properly, they don't do much for now.

Checklist

  • Parsing enums and unions
  • Basic enums and unions implementations in the VM
  • ???

Syntax preview:

Enums:

enum MyEnum {
  name: Type;
  size: Int32;
}

Unions:

union MyUnion {
  name: Type;
  field: Type;
}

The following example parses and executes by vm properly:

class MyClass {
	a: Int32;
}
enum MyEnum { a: Int32; }

union MyUnion {
	a: Int32;
	b: Int32;
	c: MyEnum;
}

func main() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions