Closed heasm66 closed 1 year ago
A warning seems sensible.
These cases can also be detected with the --trace VERBS
option:
Grammar table: 2 verbs
Verb '???'
* -> Action1
Verb 'verb-1'
* -> Action1
* noun -> Action2
I think it suffices to write out zero grammar lines (in tables.c) in the warning case ('???'
, no dict word with this verb number).
I agree that a warning is sensible. The file isn't corrupt but you get alerted that you can do some cleaning up in your verb-extensions.
Fixed in pull request https://github.com/DavidKinder/Inform6/pull/206 . This both displays a warning and saves the memory wasted in the grammar table.
I changed my mind a couple of times about whether a warning is appropriate. After all, an author can use Extend only
to remove verbs from the standard library. Should we tell them not to? I decided it's cleaner to use Extend replace
. The warning is a hint to this effect.
I noticed in the newly released "Dorm Game" that it have two sets of grammar-lines that don't have any verb connected to them.
Output from Infodump:
Verb 187 looks the same and there are no word in the dictionary with verb-number 187 or 227.
Apparently it's extend only that's the culprit for this state. The code below produces it :
When the last of the verb gets extended to a new verb, the old is left in place. One solution could be that, when the last verb is in the process of being removed, just drop the
only
token and extend the verb in-place instead.But there are some edge caes to consider when two or more verbs are emptied, or some verbs gets emptied but some not.
Both "listen" and "jump" are emptied --> both could be changed in place, but also combined into one and the other removed.
"sit" isn't emptied but "stand" is --> "sit" should move to "stand".
An alternative solution could be to let the
only
token run its course and then have a post-process that removes empty slots, renumbers and compacts the table.This isn't game-breaking, the verbs and grammar-lines are correctly formatted, but at least there could be a warning when the last verb is removed from its grammar-lines.