diff --git a/src/dict.c b/src/dict.c
index caa398d..748a991 100644
--- a/src/dict.c
+++ b/src/dict.c
@@ -792,10 +792,10 @@
  * Return OK or FAIL.  Returns NOTDONE for {expr}.
  */
     int
-eval_dict(char_u **arg, typval_T *rettv, int flags, int literal)
+eval_dict(char_u **arg, typval_T *rettv, evalarg_T *evalarg, int literal)
 {
-    int		evaluate = flags & EVAL_EVALUATE;
-    evalarg_T	evalarg;
+    int		evaluate = evalarg == NULL ? FALSE
+					 : evalarg->eval_flags & EVAL_EVALUATE;
     dict_T	*d = NULL;
     typval_T	tvkey;
     typval_T	tv;
@@ -804,9 +804,8 @@
     char_u	*start = skipwhite(*arg + 1);
     char_u	buf[NUMBUFLEN];
     int		vim9script = current_sctx.sc_version == SCRIPT_VERSION_VIM9;
-
-    CLEAR_FIELD(evalarg);
-    evalarg.eval_flags = flags;
+    int		had_comma;
+    int		getnext;
 
     /*
      * First check if it's not a curly-braces thing: {expr}.
@@ -833,11 +832,14 @@
     tv.v_type = VAR_UNKNOWN;
 
     *arg = skipwhite(*arg + 1);
+    eval_next_non_blank(*arg, evalarg, &getnext);
+    if (getnext)
+	*arg = eval_next_line(evalarg);
     while (**arg != '}' && **arg != NUL)
     {
 	if ((literal
 		? get_literal_key(arg, &tvkey)
-		: eval1(arg, &tvkey, &evalarg)) == FAIL)	// recursive!
+		: eval1(arg, &tvkey, evalarg)) == FAIL)	// recursive!
 	    goto failret;
 
 	if (**arg != ':')
@@ -857,9 +859,17 @@
 		goto failret;
 	    }
 	}
+	if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1]))
+	{
+	    semsg(_(e_white_after), ":");
+	    goto failret;
+	}
 
 	*arg = skipwhite(*arg + 1);
-	if (eval1(arg, &tv, &evalarg) == FAIL)	// recursive!
+	eval_next_non_blank(*arg, evalarg, &getnext);
+	if (getnext)
+	    *arg = eval_next_line(evalarg);
+	if (eval1(arg, &tv, evalarg) == FAIL)	// recursive!
 	{
 	    if (evaluate)
 		clear_tv(&tvkey);
@@ -887,15 +897,30 @@
 	}
 	clear_tv(&tvkey);
 
+	// the comma must come after the value
+	had_comma = **arg == ',';
+	if (had_comma)
+	{
+	    if (vim9script && (*arg)[1] != NUL && !VIM_ISWHITE((*arg)[1]))
+	    {
+		semsg(_(e_white_after), ",");
+		goto failret;
+	    }
+	    *arg = skipwhite(*arg + 1);
+	}
+
+	// the "}" can be on the next line
+	eval_next_non_blank(*arg, evalarg, &getnext);
+	if (getnext)
+	    *arg = eval_next_line(evalarg);
 	if (**arg == '}')
 	    break;
-	if (**arg != ',')
+	if (!had_comma)
 	{
 	    if (evaluate)
 		semsg(_(e_missing_dict_comma), *arg);
 	    goto failret;
 	}
-	*arg = skipwhite(*arg + 1);
     }
 
     if (**arg != '}')
