diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-04-29 10:56:48 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-04-29 12:04:22 +0200 |
| commit | 1e85f7b9af8e29f06a22eb1ff325de2a40072738 (patch) | |
| tree | fbbe16d0eb26f84ad22b82e0925420b1177798e2 /pkg/compiler/testdata | |
| parent | c7f6891ca7dc623ed77840580cb9270c61d200ee (diff) | |
pkg/ast: support char constants
Frequently it's useful to do something like:
int8['a':'z']
punctuation = ',', '-', ':'
Diffstat (limited to 'pkg/compiler/testdata')
| -rw-r--r-- | pkg/compiler/testdata/all.txt | 6 | ||||
| -rw-r--r-- | pkg/compiler/testdata/errors2.txt | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/pkg/compiler/testdata/all.txt b/pkg/compiler/testdata/all.txt index 081bb1aab..d451f5a60 100644 --- a/pkg/compiler/testdata/all.txt +++ b/pkg/compiler/testdata/all.txt @@ -6,6 +6,7 @@ foo$1(a int8[C1:C2]) foo$2(a ptr[out, array[int32]]) foo$3(a union_arg) foo$4() r0 +foo$5(a int8['a':'z']) resource r0[intptr] @@ -139,8 +140,8 @@ type templ_struct1[C] { } union_with_templ_struct [ - f1 templ_struct0[C1, type0] - f2 templ_struct0[C2, struct0] + f1 templ_struct0[C1, type0] + f2 templ_struct0[C2, struct0] ] [varlen] struct0 { @@ -183,7 +184,6 @@ foo$templ4(a ptr[in, templ_struct1[3]]) foo$templ5(a ptr[in, templ_struct1[3]]) foo$templ6(a ptr[in, templ_struct4]) - # Structs. s0 { diff --git a/pkg/compiler/testdata/errors2.txt b/pkg/compiler/testdata/errors2.txt index 86148a563..69fa46e62 100644 --- a/pkg/compiler/testdata/errors2.txt +++ b/pkg/compiler/testdata/errors2.txt @@ -183,5 +183,6 @@ foo$505(a proc[20, 0]) ### proc per-process values must not be 0 foo$506(a ptr[in, array[int32, 0]]) ### arrays of size 0 are not supported foo$507(a ptr[in, array[int32, 0:0]]) ### arrays of size 0 are not supported foo$508(a ptr[in, string["foo", 3]]) ### string value "foo\x00" exceeds buffer length 3 +foo$509(a int8['b':'a']) ### bad int range [98:97] type type500 proc[C1, 8, int8] ### values starting from 1 with step 8 overflow base type for 32 procs |
