### 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
String result;
	int from = 0;
	int buffer_start = 0;
	const int len = line.length();
	bool process = true;
	while (process) {
		switch (r_state) {
			case DOC_LINE_NORMAL: {
				int lb_pos = line.find_char('[', from);
				if (lb_pos < 0) {
					process = false;
					break;
				}
				int rb_pos = line.find_char(']', lb_pos + 1);
				if (rb_pos < 0) {
					process = false;
					break;
				}
				from = rb_pos + 1;
				String tag = line.substr(lb_pos + 1, rb_pos - lb_pos - 1);
				if (tag == "code") {
					r_state = DOC_LINE_IN_CODE;
				} else if (tag == "codeblock") {
					if (lb_pos == 0) {
						line_join = "\n";
					} else {
						result += line.substr(buffer_start, lb_pos - buffer_start) + '\n';
					}
					result += "[codeblock]";
					if (from < len) {