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

Merge pull request #48 from neroden/parser-hook-for-compliant-characters

Parser hook for compliant characters
This commit is contained in:
Graham Nelson 2022-05-23 17:01:42 +01:00 committed by GitHub
commit d3cb3912db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;
}