GDScript: Replace abstract keyword with @abstract annotation

Co-authored-by: Danil Alexeev <dalexeev12@yandex.ru>
This commit is contained in:
Aaron Franke 2025-06-19 04:53:15 -07:00
parent 88b9932ce1
commit 1085200f51
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
31 changed files with 179 additions and 197 deletions

View file

@ -101,7 +101,6 @@ static const char *token_names[] = {
"match", // MATCH,
"when", // WHEN,
// Keywords
"abstract", // ABSTRACT,
"as", // AS,
"assert", // ASSERT,
"await", // AWAIT,
@ -200,7 +199,6 @@ bool GDScriptTokenizer::Token::is_identifier() const {
case IDENTIFIER:
case MATCH: // Used in String.match().
case WHEN: // New keyword, avoid breaking existing code.
case ABSTRACT:
// Allow constants to be treated as regular identifiers.
case CONST_PI:
case CONST_INF:
@ -216,7 +214,6 @@ bool GDScriptTokenizer::Token::is_node_name() const {
// This is meant to allow keywords with the $ notation, but not as general identifiers.
switch (type) {
case IDENTIFIER:
case ABSTRACT:
case AND:
case AS:
case ASSERT:
@ -491,7 +488,6 @@ GDScriptTokenizer::Token GDScriptTokenizerText::annotation() {
#define KEYWORDS(KEYWORD_GROUP, KEYWORD) \
KEYWORD_GROUP('a') \
KEYWORD("abstract", Token::ABSTRACT) \
KEYWORD("as", Token::AS) \
KEYWORD("and", Token::AND) \
KEYWORD("assert", Token::ASSERT) \