From 66288e0e0b7af2f82427cfcfad606ea21880a837 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 7 Jan 2018 21:38:54 +0100 Subject: pkg/compiler: add builtin bool type aliases This adds builtin: type bool8 int8[0:1] type bool16 int16[0:1] type bool32 int32[0:1] type bool64 int64[0:1] type boolptr intptr[0:1] We used to use just int's for bools. But bool types provide several advantages: - make true/false probability equal - improve description expressiveness - reduce search space (we will take advantage of this later) --- pkg/ast/testdata/all.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/ast') diff --git a/pkg/ast/testdata/all.txt b/pkg/ast/testdata/all.txt index fedcc51a2..268b49a47 100644 --- a/pkg/ast/testdata/all.txt +++ b/pkg/ast/testdata/all.txt @@ -46,7 +46,7 @@ s2 { } -type bool8 int8 +type mybool8 int8 type net_port proc[1, 2, int16be] -type bool16 ### unexpected '\n', expecting int, identifier, string +type mybool16 ### unexpected '\n', expecting int, identifier, string type type4:4 int32 ### unexpected ':', expecting int, identifier, string -- cgit mrf-deployment