From 2e35bb9a19c0711162e650f3723e2dbe061051ee Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Fri, 10 Nov 2023 12:55:23 +0100 Subject: compiler: support flags as int first argument This commit adds support for the following syntax: int_flags = 1, 5, 8, 9 int32[int_flags] which is equivalent to: int_flags = 1, 5, 8, 9 flags[int_flags, int32] The second int type argument, align, is not allowed if the first argument is a flag. The compiler will also error if the first argument appears to be a flag (is ident and has no colon), but can't be found in the map of flags. Signed-off-by: Paul Chaignon --- pkg/compiler/testdata/all.txt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkg/compiler/testdata/all.txt') diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt index 6fd9f7cc6..1b3873bf5 100644 --- a/pkg/compiler/testdata/all.txt +++ b/pkg/compiler/testdata/all.txt @@ -20,6 +20,7 @@ foo_12(a int64[0:-1, 0x1000]) foo_13() (disabled) foo_14() r0 (timeout[100]) foo_15() r0 (disabled, timeout[C1], prog_timeout[C2]) +foo_16(a int32[int_flags]) resource r0[intptr] @@ -180,6 +181,7 @@ bitfield0 { f3 int16:8[-127:0] f4 int16:8[0:255] f5 int64:64[-1:1] + f6 int32:4[int_flags] } foo_bitfield0(a ptr[in, bitfield0]) -- cgit mrf-deployment