Skip to content

Commit

Permalink
Fix for Mantis bug 1822
Browse files Browse the repository at this point in the history
  • Loading branch information
ganelson committed Apr 14, 2022
1 parent 8e07790 commit bb0508e
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
8 changes: 8 additions & 0 deletions inform7/Tests/Test Cases/PhraseTokenSpecificAction.txt
@@ -0,0 +1,8 @@
Foo is a room.
To clomp (Z - looking): say "Clomp!".

When play begins:
let Z be the action of looking;
clomp Z;
let Z be the action of examining the player;
clomp Z;
@@ -0,0 +1,14 @@
Foo
Clomp!

*** Run-time problem P47 (at paragraph 8 in the source text): Phrase applied to an incompatible kind of value.


Welcome
An Interactive Fiction
Release 1 / Serial number 160428 / Inform 7 v10.1.0 / D

Foo

> > Foo
> Are you sure you want to quit?
5 changes: 3 additions & 2 deletions inform7/assertions-module/Chapter 5/Parsing Type Data.w
Expand Up @@ -400,9 +400,10 @@ void ParsingIDTypeData::phtd_main_prototype(id_type_data *idtd) {
}

@<Phrase tokens cannot be quantified@> =
if (Node::is(spec, TEST_VALUE_NT)) {
if (Specifications::is_description(spec)) {
pcalc_prop *prop = Descriptions::to_proposition(spec);
if (Binding::number_free(prop) != 1) {
LOG("Spec is: $T\nProposition is: $D\n", spec, prop);
Problems::quote_source(1, current_sentence);
Problems::quote_wording(2, Node::get_text(spec));
StandardProblems::handmade_problem(Task::syntax_tree(),
Expand All @@ -416,7 +417,7 @@ void ParsingIDTypeData::phtd_main_prototype(id_type_data *idtd) {
Problems::issue_problem_end();
return;
}
}
} else if (Node::is(spec, TEST_VALUE_NT)) spec = spec->down;

@<Sort out the kind variables in this declaration@> =
int i, t = 0;
Expand Down
7 changes: 4 additions & 3 deletions inform7/values-module/Chapter 2/Descriptions.w
Expand Up @@ -16,9 +16,10 @@ parse_node *Descriptions::from_proposition(pcalc_prop *prop, wording W) {
}

pcalc_prop *Descriptions::to_proposition(parse_node *spec) {
if (Specifications::is_description(spec)) spec = spec->down;
else {
LOG("Spec: $P\n", spec);
if ((Specifications::is_description(spec)) || (Node::is(spec, TEST_VALUE_NT))) {
spec = spec->down;
} else {
LOG("Spec: $T\n", spec);
internal_error("tried to extract proposition from non-description");
}
if (Rvalues::is_CONSTANT_construction(spec, CON_description))
Expand Down

0 comments on commit bb0508e

Please sign in to comment.