Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser hook for compliant characters #48

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions inform7/Internal/Inter/CommandParserKit/Sections/Parser.i6t
Expand Up @@ -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;

Expand All @@ -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;
Expand All @@ -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;
}

Expand Down