Note: I separated check_variable and check_identifier because the latter will be used to check function names in the scenegraph branch.