### 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
}
				break;
			case GDScriptParser::DataType::CLASS:
				if (ClassDB::is_parent_class(export_type.native_type, SNAME("Resource"))) {
					variable->export_info.type = Variant::OBJECT;
					variable->export_info.hint = PROPERTY_HINT_RESOURCE_TYPE;
					variable->export_info.hint_string = export_type.to_string();
				} else if (ClassDB::is_parent_class(export_type.native_type, SNAME("Node"))) {
					variable->export_info.type = Variant::OBJECT;
					variable->export_info.hint = PROPERTY_HINT_NODE_TYPE;
					variable->export_info.hint_string = export_type.to_string();
				} else {
					push_error(R"(Export type can only be built-in, a resource, a node, or an enum.)", variable);
					return false;
				}
				break;
			case GDScriptParser::DataType::SCRIPT: {
				StringName class_name;
				StringName native_base;
				if (export_type.script_type.is_valid()) {
					class_name = export_type.script_type->get_language()->get_global_class_name(export_type.script_type->get_path());
					native_base = export_type.script_type->get_instance_base_type();
				}
				if (class_name == StringName()) {
					Ref<Script> script = ResourceLoader::load(export_type.script_path, SNAME("Script"));
					if (script.is_valid()) {
						class_name = script->get_language()->get_global_class_name(export_type.script_path);
						native_base = script->get_instance_base_type();
					}
				}