MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / is_identifier

Method is_identifier

modules/gdscript/gdscript_tokenizer.cpp:203–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203bool GDScriptTokenizer::Token::is_identifier() const {
204 /// @note Most keywords should not be recognized as identifiers.
205 /// These are only exceptions for stuff that already is on the engine's API.
206 switch (type) {
207 case IDENTIFIER:
208 case MATCH: // Used in String.match().
209 case WHEN: // New keyword, avoid breaking existing code.
210 // Allow constants to be treated as regular identifiers.
211 case CONST_PI:
212 case CONST_INF:
213 case CONST_NAN:
214 case CONST_TAU:
215 return true;
216 default:
217 return false;
218 }
219}
220
221bool GDScriptTokenizer::Token::is_node_name() const {
222 // This is meant to allow keywords with the $ notation, but not as general identifiers.

Callers 5

checkMethod · 0.80
parse_precedenceMethod · 0.80
parse_identifierMethod · 0.80
get_classes_usedMethod · 0.80
find_functionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected