The following code stops the rule and produces a parser error:
After reading a command:
if the player’s command includes “x [a thing] and”, say “This isn’t printed.”.
It looks like Inform assumes that the “and” is signalling a second action, but why does this happen when evaluating the condition? Is this expected?
That’s interesting. It seems that “x [a thing]” is never matched when examining multiple things. So “x [a thing]” and “x [a thing] and” won’t match, but “x”, “[a thing]” and “and” each match separately.
So the workaround would be
if the player's command includes "x" and the player's command includes "[a thing]" and the player's command includes "and", say ...
Of course now the order isn’t preserved (it matches “and thing x” as well) but that’s probably an edge case.
Sorry about not being clear. Here is the parser error, which Juhana correctly points out is related to combining objects:
You can’t use multiple objects with that verb.
Note also that this isn’t exclusive to “x.” Other actions will produce the same error.
In the work around, I actually slipped in a regular expression to make sure the verb part is at the start.