Closed erkyrath closed 2 months ago
The generated grammar table can go bad when this happens. See this example:
Constant Story "Test";
Constant Headline "^A test^";
Release 1;
Include "Parser";
Include "VerbLib";
[ Initialise;
location = Kitchen;
];
Object Kitchen "Kitchen"
with description "The kitchen.",
has light;
Include "Grammar";
[ PopSub;
print "Pop.^";
];
[ DingSub;
print "Ding.^";
];
Verb 'pop' * -> Pop;
Verb 'stockpile' * -> Ding;
Verb 'stockpilexx' * -> Ding;
Verb 'ding' * -> Ding;
Kitchen The kitchen.
>stockpile Pop.
Note that we get the wrong action number out.
That was Glulx. In Zcode:
>stockpile Time passes.
>showverb stockpile Verb 'stockpile' 'wait' 'z'
- -> Wait
I think that in make_verb(), we need to call dictionary_add() earlier and track verbs by their dict word number, not their string value.
It's not the grammar table that's bad, but #dict_par2
of the verb word. We wind up calling dictionary_add() with the same dict word and two different flag2 values. These get bitwise-or'd together, producing nonsense.
I suppose one option is to accept this and treat it like an implicit Extend
. That is, just treat this as a legal way to extend a verb:
Verb 'take' 'inventory' * -> Inv;
Verb 'take' noun * -> Take;
There's been no call for this by I6 authors, but it might make life easier for I7.
I split off the last idea as a separate task, so this can be closed with https://github.com/DavidKinder/Inform6/pull/287 .
This is accepted:
It should trigger a "Two different verb definitions refer to 'stockpile'" error.
Same with this (assuming the standard DICT_WORD_SIZE=9):