Closed DavidGriffith closed 4 months ago
This is a bit of a nuisance. The problem is that 'pronoun'
and 'pronouns'
are different verbs in V5, but the same verb in V3.
If you want PunyInform to support all Z-machine versions, it's best to write
Verb 'pronoun' * -> Pronoun;
#IFV5;
Verb 'pronouns' * -> Pronoun;
#ENDIF;
(The #IFV5
directive is badly named -- it really means "version 4 or later, or Glulx.")
Does this have to do with the meta flag, or can this pop up in other verbs as well?
Could the compiler detect this case (a list of synonymous verbs holds the same verb two or more times), and just ignore all occurences but the first?
I've implemented the change and tested with the trunk version of Inform 6.43. Both 'pronoun' and 'pronouns' work in z3 and z5, and there are no errors.
Does this have to do with the meta flag
No.
Could the compiler detect this case (a list of synonymous verbs holds the same verb two or more times), and just ignore all occurences but the first?
Hm. Maybe. I'll have to look at the verb-parsing code again.
When I try to compile a test program using the latest PunyInform (66096d6c1b2b364d112ef289b0d8dcd4d103c94a) and the latest Inform6 compiler (https://github.com/DavidKinder/Inform6/commit/5885e84b525e757d3395f1846f5bae31131866a6) I get this:
This is similar to a bug in the Standard Library which was reported at https://gitlab.com/DavidGriffith/inform6lib/-/issues/140 by @erkyrath :
He also writes:
The problem I found with PunyInform doesn't deal with infix verbs.
The following works, but I'm unsure if it's correct: If I change the line at https://github.com/johanberntsson/PunyInform/blob/master/lib/grammar.h#L1367 from
Verb meta 'pronoun' 'pronouns'
toVerb meta 'pronoun'
will correct the compile time problem and still allow the player to typePRONOUNS
and get the expected response.