diff --git a/inform7/Tests/Test Cases/PhraseTokenSpecificAction.txt b/inform7/Tests/Test Cases/PhraseTokenSpecificAction.txt new file mode 100644 index 0000000000..9744625393 --- /dev/null +++ b/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; diff --git a/inform7/Tests/Test Cases/_Results_Ideal/PhraseTokenSpecificAction.txt b/inform7/Tests/Test Cases/_Results_Ideal/PhraseTokenSpecificAction.txt new file mode 100644 index 0000000000..00de7d0aa1 --- /dev/null +++ b/inform7/Tests/Test Cases/_Results_Ideal/PhraseTokenSpecificAction.txt @@ -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? \ No newline at end of file diff --git a/inform7/assertions-module/Chapter 5/Parsing Type Data.w b/inform7/assertions-module/Chapter 5/Parsing Type Data.w index 6ec82060b9..4bbbbbc990 100644 --- a/inform7/assertions-module/Chapter 5/Parsing Type Data.w +++ b/inform7/assertions-module/Chapter 5/Parsing Type Data.w @@ -400,9 +400,10 @@ void ParsingIDTypeData::phtd_main_prototype(id_type_data *idtd) { } @ = - 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(), @@ -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; @ = int i, t = 0; diff --git a/inform7/values-module/Chapter 2/Descriptions.w b/inform7/values-module/Chapter 2/Descriptions.w index b4190a9347..388c6dc1d5 100644 --- a/inform7/values-module/Chapter 2/Descriptions.w +++ b/inform7/values-module/Chapter 2/Descriptions.w @@ -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))