diff options
author | Ryo Nihei <nihei.dev@gmail.com> | 2021-07-02 00:04:56 +0900 |
---|---|---|
committer | Ryo Nihei <nihei.dev@gmail.com> | 2021-07-02 00:15:02 +0900 |
commit | 24d9877e822c400240a7e86cf8835971ed969ac7 (patch) | |
tree | f5bfca4fb67be35f5eadbda5249d31db79d331f9 /spec/lexer_test.go | |
parent | Simplify syntax of modifiers and semantic actions (diff) | |
download | cotia-24d9877e822c400240a7e86cf8835971ed969ac7.tar.gz cotia-24d9877e822c400240a7e86cf8835971ed969ac7.tar.xz |
Prohibit defining identifiers beginning with an underscore
Identifiers beginning with an underscore are used as auto-generated identifiers.
Diffstat (limited to 'spec/lexer_test.go')
-rw-r--r-- | spec/lexer_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
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 @@ -78,6 +78,11 @@ bar // This is the fourth comment. }, }, { + 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`, err: synErrUnclosedTerminal, |