From 07e96d70555626f82063d213e89e22293ecca2e3 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Thu, 22 Jun 2017 11:33:24 +1000 Subject: [PATCH] Pack token disambiguation keys a little tighter. --- lang/token/list.go | 50 +++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lang/token/list.go b/lang/token/list.go index 2fb2acbc..05e2a928 100644 --- a/lang/token/list.go +++ b/lang/token/list.go @@ -124,8 +124,8 @@ func (t Token) IsNumType() bool { return Flags(t.ID)&FlagsNumType != 0 // - [0x40, 0x5F] are operators, such as "+", "==" and "not". // - [0x60, 0x7F] are keywords, such as "if" and "return". // - [0x80, 0x8F] are literals, such as "false" and "true". -// - [0x90, 0xBF] are identifiers, such as "bool" and "u32". -// - [0xC0, 0xFF] are disambiguation forms, e.g. unary "+" vs binary "+". +// - [0x90, 0xCF] are identifiers, such as "bool" and "u32". +// - [0xD0, 0xFF] are disambiguation forms, e.g. unary "+" vs binary "+". // // "Squiggly" means a sequence of non-alpha-numeric characters, such as "+" and // "&=". Their Keys range in [0x01, 0x7F]. @@ -410,32 +410,32 @@ const ( // The IDXFoo IDs are not returned by the tokenizer. They are used by the // ast.Node ID-typed fields to disambiguate e.g. unary vs binary plus. const ( - minXKey = 0xC0 + minXKey = 0xD0 maxXKey = 0xFF - IDXUnaryPlus = ID(0xC0<