### 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
type->type_chain.push_back(type_element);
	if (match(GDScriptTokenizer::Token::BRACKET_OPEN)) {
		
		type->container_type = parse_type(false); 
		if (type->container_type == nullptr) {
			push_error(R"(Expected type for collection after "[".)");
			complete_extents(type);
			type = nullptr;
		} else if (type->container_type->container_type != nullptr) {
			push_error("Nested typed collections are not supported.");
		}
		consume(GDScriptTokenizer::Token::BRACKET_CLOSE, R"(Expected closing "]" after collection type.)");
		if (type != nullptr) {
			complete_extents(type);
		}
		return type;
	}
	int chain_index = 1;
	while (match(GDScriptTokenizer::Token::PERIOD)) {
		make_completion_context(COMPLETION_TYPE_ATTRIBUTE, type, chain_index++);
		if (consume(GDScriptTokenizer::Token::IDENTIFIER, R"(Expected inner type name after ".".)")) {
			type_element = parse_identifier();
			type->type_chain.push_back(type_element);
		}
	}
	complete_extents(type);
	return type;
}
#ifdef TOOLS_ENABLED
enum DocLineState {