From ca80eeaa812b49afea75d3084d0c62770e4a8d18 Mon Sep 17 00:00:00 2001 From: Marc Vertes Date: Wed, 7 Jan 2026 12:09:20 +0100 Subject: fix: set 'HasInit' token property in language definition --- lang/spec.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'lang/spec.go') diff --git a/lang/spec.go b/lang/spec.go index 37017e7..b8539e3 100644 --- a/lang/spec.go +++ b/lang/spec.go @@ -35,9 +35,10 @@ const ( // TokenProp represent token properties for parsing. type TokenProp struct { Token - SkipSemi bool // automatic semicolon insertion after newline - Precedence int // operator precedence - Associativity + SkipSemi bool // automatic semicolon insertion after newline + Precedence int // operator precedence + Associativity // + HasInit bool // true if may have an init clause } // Spec represents the language specification for scanning. @@ -52,12 +53,3 @@ type Spec struct { NumUnder bool // true if a number can contain _ character // TokenProps map[string]TokenProp // token properties } - -// HasInit stores if a statement may contain a simple init statement. -var HasInit = map[Token]bool{ - Case: true, - For: true, - If: true, - Select: true, - Switch: true, -} -- cgit v1.2.3