### Godot version

Godot Engine v4.0.beta10.official.d0398f62f

### System information

Windows 10

### Issue description

Even though the syntax highlighting is correct, the following errors are raised, unless quotes are used.

`Expected node path as string or identifier after "$".`
`Invalid numeric notation.`
`Expected statement, found "Literal" instead.`

### Steps to reproduce

1. Add a node named "2D" to the scene
2. In a script, use `$2D`
3. The errors above are shown, even though the highlighting works fine

### Minimal reproduction project

[node-starts-with-number.zip](https://github.com/godotengine/godot/files/10332763/node-starts-with-number.zip)

if (!in_number && !in_word && is_a_digit) {
			in_number = true;
		}
		
		if (in_number && !is_a_digit) {
			if (str[j] == 'b' && str[j - 1] == '0') {
				is_bin_notation = true;
			} else if (str[j] == 'x' && str[j - 1] == '0') {
				is_hex_notation = true;
			} else if (!((str[j] == '-' || str[j] == '+') && str[j - 1] == 'e' && !prev_is_digit) &&
					!(str[j] == '_' && (prev_is_digit || str[j - 1] == 'b' || str[j - 1] == 'x' || str[j - 1] == '.')) &&
					!(str[j] == 'e' && (prev_is_digit || str[j - 1] == '_')) &&
					!(str[j] == '.' && (prev_is_digit || (!prev_is_binary_op && (j > 0 && (str[j - 1] == '-' || str[j - 1] == '+' || str[j - 1] == '~'))))) &&
					!((str[j] == '-' || str[j] == '+' || str[j] == '~') && !prev_is_binary_op && str[j - 1] != 'e')) {
				/* This condition continues Number highlighting in special cases.
				1st row: '+' or '-' after scientific notation;
				2nd row: '_' as a numeric separator;
				3rd row: Scientific notation 'e' and floating points;
				4th row: Floating points inside the number, or leading if after a unary mathematical operator;
				5th row: Multiple unary mathematical operators */
				in_number = false;
			}
		} else if (!is_binary_op && (str[j] == '-' || str[j] == '+' || str[j] == '~' || (str[j] == '.' && str[j + 1] != '.' && (j == 0 || (j > 0 && str[j - 1] != '.'))))) {
			in_number = true;
		}
		if (!in_word && (is_ascii_char(str[j]) || is_underscore(str[j])) && !in_number) {
			in_word = true;
		}
		if (is_a_symbol && str[j] != '.' && in_word) {
			in_word = false;