From 1e85f7b9af8e29f06a22eb1ff325de2a40072738 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 29 Apr 2018 10:56:48 +0200 Subject: pkg/ast: support char constants Frequently it's useful to do something like: int8['a':'z'] punctuation = ',', '-', ':' --- pkg/compiler/testdata/all.txt | 6 +++--- pkg/compiler/testdata/errors2.txt | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'pkg/compiler/testdata') 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 -- cgit mrf-deployment