There are some places in my game where the player might want to say just ENTER, without a noun, because what they are entering is obvious from context and the place being entered is actually a room, not a container. I tried (for example)
Instead of entering when the location is Outside The Post Office:
now the player is in The Post Office.
but the standard response is “You must supply a noun.”
and I also use the specific noun present case, which works
Instead of entering The Post Office when the location is Outside The Post Office:
now the player is in The Post Office.
I suppose I could parse out the ‘enter with no noun’ case from the input line, but is there a more elegant approach?
The standard “enter” grammar is defined both with and without the noun. So you can define a “supplying a missing noun” rule to handle this case. See 18.32.
Alternatively, you could use the “inside” and “outside” directions to link the two locations - in that case, ENTER and EXIT will automatically convert to going actions.