From 24d9877e822c400240a7e86cf8835971ed969ac7 Mon Sep 17 00:00:00 2001 From: Ryo Nihei Date: Fri, 2 Jul 2021 00:04:56 +0900 Subject: Prohibit defining identifiers beginning with an underscore Identifiers beginning with an underscore are used as auto-generated identifiers. --- spec/lexer_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'spec/lexer_test.go') diff --git a/spec/lexer_test.go b/spec/lexer_test.go index 2dc346e..0209b59 100644 --- a/spec/lexer_test.go +++ b/spec/lexer_test.go @@ -77,6 +77,11 @@ bar // This is the fourth comment. newEOFToken(), }, }, + { + caption: "identifiers beginning with an underscore are not allowed because they are used only auto-generated identifiers", + src: `_abc`, + err: synErrAutoGenID, + }, { caption: "an unclosed terminal is not a valid token", src: `"abc`, -- cgit v1.2.3