From 44a5ca633e186c5836010366c515a4017836121b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 29 Apr 2022 09:15:41 +0200 Subject: pkg/ast, pkg/compiler: support per-file metadata We have a bunch of hacks in syz-extract, syz-sysgen and syz-check with respect to description files unsupported on some arches, or that must not be part of make extract. Add 2 meta attribtues to files: meta noextract Tells `make extract` to not extract constants for this file. Though, `syz-extract` can still be invoked manually on this file. meta arches["arch1", "arch2"] Restricts this file only to the given set of architectures. `make extract` and ``make generate` will not use it on other architectures. Later we can potentially use meta attributes to specify git tree/commit that must be used for extraction. Maybe something else. Fixes #2754 --- pkg/ast/testdata/errors.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'pkg/ast/testdata/errors.txt') diff --git a/pkg/ast/testdata/errors.txt b/pkg/ast/testdata/errors.txt index 463158756..2b022c149 100644 --- a/pkg/ast/testdata/errors.txt +++ b/pkg/ast/testdata/errors.txt @@ -5,6 +5,10 @@ foo ### unexpected '\n', expecting '(', '{', '[', '=' % ### illegal character U+0025 '%' +meta ### unexpected '\n', expecting int, identifier, string +meta: foo ### unexpected ':', expecting int, identifier, string +meta foo, bar ### unexpected ',', expecting '\n' + int_flags0 = 0, 0x1, 0xab int_flags1 = 123ab0x ### bad integer "123ab0x" int_flags1 == 0, 1 ### unexpected '=', expecting int, identifier, string @@ -93,4 +97,4 @@ s5 { f0 int8 ( ### unexpected '\n', expecting int, identifier, string s6 { - f0 int8 () ### unexpected ')', expecting int, identifier, string \ No newline at end of file + f0 int8 () ### unexpected ')', expecting int, identifier, string -- cgit mrf-deployment