diff --git a/parser/parser_test.go b/parser/parser_test.go index d433d64..e8d175b 100644 --- a/parser/parser_test.go +++ b/parser/parser_test.go @@ -158,3 +158,37 @@ objt ro Init:Obj `, test) } +func TestEnum (test *testing.T) { + checkTree ("../tests/parser/enum", +`:arf +--- +enum ro AffrontToGod:{Int 4} + bird0 + 28394 + 9328 + 398 + 9 + bird1 + 23 + 932832 + 398 + 2349 + bird2 + 1 + 2 + 3 + 4 +enum ro NamedColor:U32 + red 0xFF0000 + green 0x00FF00 + blue 0x0000FF +enum ro Weekday:Int + sunday + monday + tuesday + wednesday + thursday + friday + saturday +`, test) +} diff --git a/parser/tree.go b/parser/tree.go index f5cf332..559dbc8 100644 --- a/parser/tree.go +++ b/parser/tree.go @@ -200,5 +200,6 @@ type EnumSection struct { what Type permission types.Permission + // TODO: order matters here we need to store these in an array members map[string] Argument } diff --git a/tests/parser/enum/main.arf b/tests/parser/enum/main.arf new file mode 100644 index 0000000..0571149 --- /dev/null +++ b/tests/parser/enum/main.arf @@ -0,0 +1,30 @@ +:arf +--- + +enum ro Weekday:Int + sunday + monday + tuesday + wednesday + thursday + friday + saturday + +enum ro NamedColor:U32 + red 0xFF0000 + green 0x00FF00 + blue 0x0000FF + +enum ro AffrontToGod:{Int 4} + bird0 + 28394 9328 + 398 9 + bird1 + 23 932832 + 398 + 2349 + bird2 + 1 + 2 + 3 + 4