There’s, I believe, a known issue in current Inform, where if you have any no.verb grammar lines (that is, Understand lines for actions that don’t start with a single fixed word) that start with a ROUTINE_FILTER token (that is, “[any whatever]”), the parser will say “that noun did not make sense in that context” instead of “that’s not a verb I recognize” for all unknown verbs.
The simplest solution is to just replace that error message, since “that noun did not make sense in that context” is an error that practically never comes up apart from this. (Formally speaking, NOTINCONTEXT_PE is thrown when a ROUTINE_FILTER or ATTR_FILTER token fails to match anything, which is pretty rare.)
Before printing a parser error when the latest parser error is the noun did not make sense in that context error: now the latest parser error is the not a verb I recognise error.
Is there a better or more standard solution to this problem, though? I’m sure I can’t be the only person to run into it. (In particular, including certain extensions—such as my own Boolean Variables—will always make it happen.)
That becomes the error reported as part of Parser Letter I:
if (etype == ASKSCOPE_PE) {
scope_stage = 3;
if (indirect(scope_error) == -1) { ! <-- NOTINCONTEXT_PE returned from call here
best_etype = nextbest_etype; ! <-- assigned to best_etype, so that's the error produced
if (~~((etype ofclass Routine) || (etype ofclass String)))
EndActivity(PRINTING_A_PARSER_ERROR_ACT);
jump GiveError;
}
}
However, the actual invocation of that code in scope_stage 3 is triggered via a routine called CantSee():
! ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
! Parser.i6t: CantSee
! ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
[ CantSee i w e;
saved_oops=oops_from;
if (scope_token ~= 0) {
scope_error = scope_token; return ASKSCOPE_PE; ! <-- here
}
wn--; w = NextWord();
e = CANTSEE_PE;
if (w == pronoun_word) {
w = NextWordStopped(); wn--;
if ((w == -1) || (line_token-->(pcount) ~= ENDIT_TOKEN)) {
if (pcount > 0) AnalyseToken(line_token-->(pcount-1));
if ((pcount > 0) && (found_ttype == ROUTINE_FILTER_TT or ATTR_FILTER_TT))
e = NOTINCONTEXT_PE;
else {
pronoun__word = pronoun_word; pronoun__obj = pronoun_obj;
e = ITGONE_PE;
}
}
}
if (etype > e) return etype;
return e;
];
… so it’s possible to bypass it in this routine with something like: