From 531d4f46c5c6e3536c6d451ff3ae6f95fe1dcf2e Mon Sep 17 00:00:00 2001 From: meyermarcel Date: Sat, 16 Nov 2024 16:55:18 +0100 Subject: [PATCH] Add new predeclared identifiers (#163) * See https://go.dev/ref/spec#Predeclared_identifiers --- bootstrap/token.go | 5 +++++ reserved_words.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/bootstrap/token.go b/bootstrap/token.go index e0bb7427..c0116fd5 100644 --- a/bootstrap/token.go +++ b/bootstrap/token.go @@ -102,8 +102,10 @@ var blacklistedIdents = map[string]struct{}{ "var": {}, // predeclared identifiers http://golang.org/ref/spec#Predeclared_identifiers + "any": {}, "bool": {}, "byte": {}, + "comparable": {}, "complex64": {}, "complex128": {}, "error": {}, @@ -128,6 +130,7 @@ var blacklistedIdents = map[string]struct{}{ "nil": {}, "append": {}, "cap": {}, + "clear": {}, "close": {}, "complex": {}, "copy": {}, @@ -135,6 +138,8 @@ var blacklistedIdents = map[string]struct{}{ "imag": {}, "len": {}, "make": {}, + "max": {}, + "min": {}, "new": {}, "panic": {}, "print": {}, diff --git a/reserved_words.go b/reserved_words.go index 127d2738..3e3fc0b4 100644 --- a/reserved_words.go +++ b/reserved_words.go @@ -29,8 +29,10 @@ var reservedWords = map[string]bool{ "var": true, // predeclared identifiers http://golang.org/ref/spec#Predeclared_identifiers + "any": true, "bool": true, "byte": true, + "comparable": true, "complex64": true, "complex128": true, "error": true, @@ -55,6 +57,7 @@ var reservedWords = map[string]bool{ "nil": true, "append": true, "cap": true, + "clear": true, "close": true, "complex": true, "copy": true, @@ -62,6 +65,8 @@ var reservedWords = map[string]bool{ "imag": true, "len": true, "make": true, + "max": true, + "min": true, "new": true, "panic": true, "println": true,