### Godot version

4.0.1(flatpak)

### System information

Linux openSUSE

### Issue description

Cyclic Dependencies in shader result in infinite loop

### Steps to reproduce

Create 'main' shader that includes other shader, let's say `inc_me1` and `inc_me2` if 'inc_me1' that includes 'main' shader and 'inc_me2' includes 'inc_me1'. It results in a freeze.

### Minimal reproduction project

[Shader dependency.zip](https://github.com/godotengine/godot/files/11547654/Shader.dependency.zip)
uncomment include, and the editor will freeze and crash
found_word = true;
			} else {
				_set_unexpected_token_error(s, p_line);
				return FAILED;
			}
		}
		if (word_completed) {
			if (open_bracket) {
				_set_expected_error(")", p_line);
				return FAILED;
			}
			if (post_bracket_index != -1) {
				index_end = post_bracket_index;
			}
			String body = state->defines.has(vector_to_string(text)) ? "true" : "false";
			String temp = result;
			result = result.substr(0, index) + body;
			index_start = result.length();
			if (index_end > 0) {
				result += temp.substr(index_end);
			}
		} else {
			set_error(RTR("Invalid macro name."), p_line);
			return FAILED;
		}
	}
	r_expanded = result;
	return OK;
}
Error ShaderPreprocessor::expand_macros(const String &p_string, int p_line, String &r_expanded) {