I have some verbless grammars in my WIP. In response to TAKE ALL in a room with nothing to take I get parser error internal rule response (R) instead of “There are none at all available!”. You can see the trace below. I can understand what’s going on – the no.verb grammars are being tried last – but I wonder if there’s a way to at least print something nicer. I’m open to ideas. There are a number of places this problem crops up, but TAKE ALL is probably the most jarring of them, so I’m focusing on that first.
Thanks!
> take all
[ “take” take / “all” all ]
[Parsing for the verb ’take’ (10 lines)]
[line 0 * ’inventory’ -> Inv]
[line rejected for not ending with correct preposition]
[line 1 * multi -> Take]
[line 1 token 1 word 2 : multi]
[Object list from word 2]
[Calling NounDomain on location and actor]
<SNIP!>
Revising multiple object list of size 7 with 2nd nothing
Token 2 plural case: number with actor 0
Done: new size 0
[Parsing for the verb ’no.verb’ (2 lines)]
[line 0 * scope=Routine(1007386) -> A98_discussing]
[line 0 token 1 word 1 : scope=Routine(1007386)]
[Scope routine called at stage 1]
[Scope routine returned multiple-flag of 0]
[Object list from word 1]
[Calling NounDomain on location and actor]
[NounDomain called at word 1
seeking definite object
[Scope routine called at stage 2]
[ND made 0 matches]
[token resulted in failure with error type 18]
[line 1 * Routine(647371) noun -> A95_supplying_an_answer_with]
[line 1 token 1 word 1 : Routine(647371)]
[Outside parsing routine returned -1]
[token resulted in failure with error type 1]
I’m not sure what you’re trying to say. I might just not recognize the words
you’re using.
I’m not saying this is a good idea, because I never really figured out what unwanted side effects this might have, but when I was dealing with some annoying parser error messages, I ended up handling some situations with “Understand as a mistake” lines with conditions attached. So, for example, if the person typed “take all” when there’s nothing portable available to take, you could write “There are none at all available” or some other message.
To decide if nothing's available to take:
repeat with T running through touchable things:
if (T is not the player) and (T is not enclosed by the player) and (T is portable):
decide no;
decide yes.
Understand "take all" as a mistake ("Custom response goes here.") when nothing's available to take.
Lab is a room.
A prop is here.
Test me with "take all / take all".
The “most interesting” parser error is being set by the grammar line for the discussing action. What do the I7 grammar lines for that action look like?
I’m having trouble reproducing the behavior that you’re seeing. The parser has special logic for >TAKE ALL that seems designed to take precedence. Do you have a minimal example? (Also, what version of Inform are you using?)