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 --- sys/test/test.txt | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'sys/test') diff --git a/sys/test/test.txt b/sys/test/test.txt index 768b7b584..51e48f405 100644 --- a/sys/test/test.txt +++ b/sys/test/test.txt @@ -589,8 +589,15 @@ syz_bf_struct3 { f4 int64be:16 } +syz_bf_struct26 { + f0 bytesize[parent, int32] + f1 int32:16[bitmask_flags2] + f2 int32:16 +} + test$bf0(a0 ptr[in, syz_bf_struct0]) test$bf1(a0 ptr[in, syz_bf_struct1]) +test$bf2(a0 ptr[in, syz_bf_struct26]) # Checksums -- cgit mrf-deployment