I don’t think “Unexpected Identifier” means it’s undefined, I think it means the parser found an identifier in a place it didn’t expect to find an identifier.
If it was just undefined, the error message is Identifier twist_input not declared in the current scope.
That’s what they choose to call it. The error is: “the known name (identifier) is expected here, but the name (identifier) you provided is unknown in this context/scope and therefore not expected”
The point is: What they choose to call it is “unexpected identifier”, and that error in Godot is a result of the parser finding an identifier where it wasn’t expected, not a result of Godot finding an unknown identifier. Godot has a different error message for unknown identifiers.
The OP said “unexpected identifier”, and that, in Godot’s error reporting, tends to be an identifier in an unexpected place, like (say) outside of a function, without a var prefix. Or on the same line as another statement without a separator.
You’re right, it’s reserved for identifiers that appear in class declarations. Within functions it’s “identifier not declared”, although it’s basically the same error. Well not exactly the same because you can’t write expressions in class definitions, hence any identifier is not expected there even if it has been declared. I stand corrected.