aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ast/testdata/all.txt
blob: 268b49a47ecaf13af848ed8d38ca897d36c4ef93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Copyright 2017 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.

0x42		### unexpected int, expecting comment, define, include, resource, identifier
foo		### unexpected '\n', expecting '(', '{', '[', '='
%		### illegal character U+0025 '%'

int_flags0 = 0, 0x1, 0xab
int_flags1 = 123ab0x			### bad integer "123ab0x"
int_flags1 == 0, 1			### unexpected '=', expecting int, identifier, string
int_flags = 0, "foo"			### unexpected string, expecting int, identifier

str_flags0 = "foo", "bar"
str_flags1 = "non terminated		### string literal is not terminated
str_flags2 = "bad chars здесь"		### illegal character U+00D0 'Ð' in string literal
str_flags3 = "string", not a string	### unexpected identifier, expecting string
str_flags4 = "string", 42		### unexpected int, expecting string

call(foo ,int32 , bar int32)		### unexpected ',', expecting int, identifier, string
call(foo int32:"bar")			### unexpected string, expecting int, identifier

define FOO `bar`
define FOO `bar				### C expression is not terminated

foo(x int32[1:2:3, opt])		### unexpected ':', expecting ']'

s0 {
	f0	string[""]		### empty string literals are not supported
}

sf0 = "", "1"				### empty string literals are not supported

include <linux/foo.h>
include "linux/foo.h"
incdir </foo/bar>
incdir "/foo/bar"

s2 {
	f1	int8

	# comment

	f2	int8

	# comment

}

type mybool8 int8
type net_port proc[1, 2, int16be]
type mybool16				### unexpected '\n', expecting int, identifier, string
type type4:4 int32			### unexpected ':', expecting int, identifier, string