1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-06-28 21:14:57 +03:00

When parsing commands to actors such as JOHN, DO THIS DFSD, leave wn pointing to the first word not parsed as a command in order to allow extension authors to provide better error messages.

This commit is contained in:
Nathanael Nerode 2022-05-22 16:42:22 -04:00
parent e0a9a9eb10
commit dcbf34cfa8

View file

@ -1283,6 +1283,9 @@ communicates a snippet of words to another character, just as if the
player had typed ANSWER ARFLE BARFLE GLOOP TO PERSON. For I7 purposes, the
fake action |##NotUnderstood| does not exist.
In order to assist people who do want to parse that type of mistyped command
in extensions, wn is left pointing at the first word not parsed as a command.
=
.GiveError;
@ -1292,6 +1295,7 @@ fake action |##NotUnderstood| does not exist.
verb_wordnum = usual_grammar_after;
jump AlmostReParse;
}
m = wn; ! Save wn so extension authors can parse command errors if they want to
wn = 1;
while ((wn <= num_words) && (NextWord() ~= comma_word)) ;
parser_results-->ACTION_PRES = ##Answer;
@ -1300,6 +1304,7 @@ fake action |##NotUnderstood| does not exist.
parser_results-->INP2_PRES = 1; special_number1 = special_word;
actor = player;
consult_from = wn; consult_words = num_words-consult_from+1;
wn = m; ! Restore wn so extension authors can parse command errors if they want to
rtrue;
}