File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1+ # Throw parse error when dispatch ... with has empty params
Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ Parse_stat MCDispatchCmd::parse(MCScriptPoint& sp)
457457
458458 if (sp . skip_token (SP_REPEAT, TT_UNDEFINED, RF_WITH) == PS_NORMAL)
459459 {
460- if (getparams (sp, ¶ms) != PS_NORMAL)
460+ if (sp. is_eol () || getparams (sp, ¶ms) != PS_NORMAL)
461461 {
462462 MCperror -> add (PE_DISPATCH_BADPARAMS, sp);
463463 return PS_ERROR;
Original file line number Diff line number Diff line change @@ -136,6 +136,14 @@ class MCScriptPoint
136136
137137 return uindex_t (index);
138138 }
139+
140+ bool is_eol ()
141+ {
142+ Symbol_type t_dummy;
143+ Parse_stat t_stat = next (t_dummy);
144+ backup ();
145+ return t_stat == PS_EOL;
146+ }
139147
140148 Parse_stat skip_space ();
141149 Parse_stat skip_eol ();
You can’t perform that action at this time.
0 commit comments