### Godot version

4.0.rc1

### System information

windows 10

### Issue description

When assigning a lambda to a variable right after an if statement, the parser seems to understand that a ternary expression is happening when in fact it is not.

![image](https://user-images.githubusercontent.com/5783414/218691792-a27619cd-f17c-4d1e-9121-197c22aeec09.png)

### Steps to reproduce

Put the code bellow on a script on an empty project
```gdscript
func test():
	var v
	if true: v = (func(): test())
	if true: v = (func(): test())
	if true: v = (func(): test())

	if true: v = func(): test()
	if true: v = func(): test()
```

### Minimal reproduction project

N/A
if (class_name != StringName() && native_base != StringName() && ClassDB::is_parent_class(native_base, SNAME("Resource"))) {
					variable->export_info.type = Variant::OBJECT;
					variable->export_info.hint = PROPERTY_HINT_RESOURCE_TYPE;
					variable->export_info.hint_string = class_name;
				}
			} break;
			case GDScriptParser::DataType::ENUM: {
				variable->export_info.type = Variant::INT;
				variable->export_info.hint = PROPERTY_HINT_ENUM;
				String enum_hint_string;
				bool first = true;
				for (const KeyValue<StringName, int64_t> &E : export_type.enum_values) {
					if (!first) {
						enum_hint_string += ",";
					} else {
						first = false;
					}
					enum_hint_string += E.key.operator String().capitalize().xml_escape();
					enum_hint_string += ":";
					enum_hint_string += String::num_int64(E.value).xml_escape();
				}
				variable->export_info.hint_string = enum_hint_string;
			} break;
			default:
				push_error(R"(Export type can only be built-in, a resource, a node, or an enum.)", variable);
				break;
		}
		if (is_array) {
			String hint_prefix = itos(variable->export_info.type);
			if (variable->export_info.hint) {