summaryrefslogtreecommitdiff
path: root/lang/spec.go
diff options
context:
space:
mode:
Diffstat (limited to 'lang/spec.go')
-rw-r--r--lang/spec.go16
1 files changed, 4 insertions, 12 deletions
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,
-}