diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-01-07 21:38:54 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-01-08 12:52:31 +0100 |
| commit | 66288e0e0b7af2f82427cfcfad606ea21880a837 (patch) | |
| tree | 66a061dae128abbbd1ec29542532a22b7438037c /pkg/ast | |
| parent | 0ae499850c25196ca5b61653b3e498ed65f87725 (diff) | |
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)
Diffstat (limited to 'pkg/ast')
| -rw-r--r-- | pkg/ast/testdata/all.txt | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
