patch 8.2.2897: Vim9: can use reserved words at the script level

Problem:    Vim9: can use reserved words at the script level.
Solution:   Check variable names for reserved words. (closes #8253)
diff --git a/src/vim9script.c b/src/vim9script.c
index 02c04e2..fbb815c 100644
--- a/src/vim9script.c
+++ b/src/vim9script.c
@@ -709,10 +709,10 @@
     }
     name = vim_strnsave(arg, p - arg);
 
-    // parse type
+    // parse type, check for reserved name
     p = skipwhite(p + 1);
     type = parse_type(&p, &si->sn_type_list, TRUE);
-    if (type == NULL)
+    if (type == NULL || check_reserved_name(name) == FAIL)
     {
 	vim_free(name);
 	return p;
@@ -974,4 +974,26 @@
     return OK; // not really
 }
 
+// words that cannot be used as a variable
+static char *reserved[] = {
+    "true",
+    "false",
+    "null",
+    NULL
+};
+
+    int
+check_reserved_name(char_u *name)
+{
+    int idx;
+
+    for (idx = 0; reserved[idx] != NULL; ++idx)
+	if (STRCMP(reserved[idx], name) == 0)
+	{
+	    semsg(_(e_cannot_use_reserved_name), name);
+	    return FAIL;
+	}
+    return OK;
+}
+
 #endif // FEAT_EVAL