patch 9.0.0423: "for" and "while" not recognized after :vim9cmd and :legacy

Problem:    "for" and "while" not recognized after :vim9cmd and :legacy.
            (Emanuele Torre)
Solution:   Recognize all the command modifiers. (closes #11087)
            Add a test to check the list of modifiers.
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 0b6b217..0024c99 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2888,7 +2888,7 @@
 
 	switch (*p)
 	{
-	    // When adding an entry, also modify cmd_exists().
+	    // When adding an entry, also modify cmdmods[].
 	    case 'a':	if (!checkforcmd_noparen(&eap->cmd, "aboveleft", 3))
 			    break;
 			cmod->cmod_split |= WSP_ABOVE;
@@ -3958,11 +3958,13 @@
     {"confirm", 4, FALSE},
     {"filter", 4, FALSE},
     {"hide", 3, FALSE},
+    {"horizontal", 3, FALSE},
     {"keepalt", 5, FALSE},
     {"keepjumps", 5, FALSE},
     {"keepmarks", 3, FALSE},
     {"keeppatterns", 5, FALSE},
     {"leftabove", 5, FALSE},
+    {"legacy", 3, FALSE},
     {"lockmarks", 3, FALSE},
     {"noautocmd", 3, FALSE},
     {"noswapfile", 3, FALSE},
@@ -3974,6 +3976,7 @@
     {"unsilent", 3, FALSE},
     {"verbose", 4, TRUE},
     {"vertical", 4, FALSE},
+    {"vim9cmd", 4, FALSE},
 };
 
 /*
diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak
index dbda7e1..d7abcb5 100644
--- a/src/testdir/Make_all.mak
+++ b/src/testdir/Make_all.mak
@@ -87,6 +87,7 @@
 	test_clientserver \
 	test_close_count \
 	test_cmdline \
+	test_cmdmods \
 	test_cmdwin \
 	test_command_count \
 	test_comments \
@@ -346,6 +347,7 @@
 	test_clientserver.res \
 	test_close_count.res \
 	test_cmdline.res \
+	test_cmdmods.res \
 	test_cmdwin.res \
 	test_command_count.res \
 	test_comments.res \
diff --git a/src/testdir/test_cmdmods.vim b/src/testdir/test_cmdmods.vim
new file mode 100644
index 0000000..eb6dff1
--- /dev/null
+++ b/src/testdir/test_cmdmods.vim
@@ -0,0 +1,35 @@
+" Test for all comand modifiers in 
+
+def Test_cmdmods_array()
+  # Get all the command modifiers from ex_cmds.h.
+  var lines = readfile('../ex_cmds.h')->filter((_, l) => l =~ 'ex_wrongmodifier,')
+  var cmds = lines->map((_, v) => substitute(v, '.*"\(\k*\)".*', '\1', ''))
+
+  # :hide is both a command and a modifier
+  cmds->extend(['hide'])
+
+  # Get the entries of cmdmods[] in ex_docmd.c
+  edit ../ex_docmd.c
+  var top = search('^} cmdmods[') + 1
+  var bot = search('^};') - 1
+  lines = getline(top, bot)
+  var mods = lines->map((_, v) => substitute(v, '.*"\(\k*\)".*', '\1', ''))
+
+  # Check the lists are equal.  Convert them to a dict to get a clearer error
+  # message.
+  var cmds_dict = {}
+  for v in cmds
+    cmds_dict[v] = 1
+  endfor
+  var mods_dict = {}
+  for v in mods
+    mods_dict[v] = 1
+  endfor
+  assert_equal(cmds_dict, mods_dict)
+
+  bwipe!
+enddef
+
+
+" vim: shiftwidth=2 sts=2 expandtab
+
diff --git a/src/testdir/test_eval_stuff.vim b/src/testdir/test_eval_stuff.vim
index 0081d89..7d8421b 100644
--- a/src/testdir/test_eval_stuff.vim
+++ b/src/testdir/test_eval_stuff.vim
Binary files differ
diff --git a/src/version.c b/src/version.c
index fe87dab..445ac6d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    423,
+/**/
     422,
 /**/
     421,