From eea28fee309680462752ef7709f1a94178dce44d Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 10 May 2019 18:02:54 +0200 Subject: pkg/compiler: support complex len targets This change adds compiler support for complex path expressions in len targets. E.g. it allows to refer to a sibling field as len[parent_struct:field:another_field]. See the docs change for details. This is just a compiler change. The feature is not yet supported by the prog package. --- pkg/compiler/testdata/errors.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/compiler/testdata/errors.txt') diff --git a/pkg/compiler/testdata/errors.txt b/pkg/compiler/testdata/errors.txt index e95c3be7d..8c44694bb 100644 --- a/pkg/compiler/testdata/errors.txt +++ b/pkg/compiler/testdata/errors.txt @@ -62,7 +62,7 @@ sf2 = "a", "b" sf2 = "c" ### string flags sf2 redeclared, previously declared at LOCATION resource r2[r0]: 2 -resource r3[int32:1] ### unexpected ':', only struct fields can be bitfields +resource r3[int32:1] ### unexpected ':', only struct fields can be bitfields resource r4[int32[opt]] ### resource base can't be marked as opt resource r5[non_existent] ### unknown type non_existent resource r6[int64be] ### int64be can't be resource base (int types can) @@ -119,6 +119,9 @@ foo$61(a u6) ### u6 can't be syscall argument foo$62() u6 ### u6 can't be syscall return foo$63(a int32[1[2]]) ### range argument has subargs foo$64(a ptr[in, flags[f1[int32], int32]]) ### flags argument has subargs +foo$65(a int32, b len[1]) ### unexpected int 1 for len target argument of len type, expect identifier +foo$66(a int32, b len[a:1]) ### unexpected int 1 after colon, expect identifier +foo$67(x int32[1:2:3, opt]) ### unexpected ':' opt { ### struct uses reserved name opt f1 int32 -- cgit mrf-deployment