### 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
{
		int bracket_start_count = 0;
		int bracket_end_count = 0;
		for (int i = 0; i < p_string.size(); i++) {
			switch (p_string[i]) {
				case CURSOR:
					state->completion_type = COMPLETION_TYPE_CONDITION;
					break;
				case '(':
					bracket_start_count++;
					break;
				case ')':
					bracket_end_count++;
					break;
			}
		}
		if (bracket_start_count > bracket_end_count) {
			_set_expected_error(")", p_line);
			return FAILED;
		}
		if (bracket_end_count > bracket_start_count) {
			_set_expected_error("(", p_line);
			return FAILED;
		}
	}
	String result = p_string;