mirror of
https://github.com/ganelson/inform.git
synced 2024-06-17 07:40:47 +03:00
More on performance styles
This commit is contained in:
parent
2f786c3524
commit
711a4cbf9b
|
@ -1,6 +1,6 @@
|
|||
# Inform 7
|
||||
|
||||
[Version](notes/versioning.md): 10.2.0-beta+6V57 'Krypton' (11 September 2022)
|
||||
[Version](notes/versioning.md): 10.2.0-beta+6V58 'Krypton' (12 September 2022)
|
||||
|
||||
## About Inform
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Prerelease: beta
|
||||
Build Date: 11 September 2022
|
||||
Build Number: 6V57
|
||||
Build Date: 12 September 2022
|
||||
Build Number: 6V58
|
||||
|
|
|
@ -709,8 +709,10 @@ void Projects::construct_graph(inform_project *proj) {
|
|||
if (proj->chosen_build_target == NULL) {
|
||||
Projects::finalise_kit_dependencies(proj);
|
||||
Copies::get_source_text(proj->as_copy);
|
||||
if (proj->syntax_tree->contains_dialogue)
|
||||
if (proj->syntax_tree->contains_dialogue) {
|
||||
Projects::add_kit_dependency(proj, I"DialogueKit", NULL, NULL, NULL);
|
||||
Projects::activate_elements(proj);
|
||||
}
|
||||
build_vertex *V = proj->as_copy->vertex;
|
||||
@<Construct the graph upstream of V@>;
|
||||
@<Construct the graph downstream of V@>;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "BasicInformExtrasKit",
|
||||
"version": "10.2.0-beta+6V57"
|
||||
"version": "10.2.0-beta+6V58"
|
||||
},
|
||||
"kit-details": {
|
||||
"has-priority": 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "BasicInformKit",
|
||||
"version": "10.2.0-beta+6V57"
|
||||
"version": "10.2.0-beta+6V58"
|
||||
},
|
||||
"needs": [ {
|
||||
"unless": {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "CommandParserKit",
|
||||
"version": "10.2.0-beta+6V57"
|
||||
"version": "10.2.0-beta+6V58"
|
||||
},
|
||||
"needs": [ {
|
||||
"need": {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "EnglishLanguageKit",
|
||||
"version": "10.2.0-beta+6V57"
|
||||
"version": "10.2.0-beta+6V58"
|
||||
},
|
||||
"needs": [ {
|
||||
"need": {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "WorldModelKit",
|
||||
"version": "10.2.0-beta+6V57"
|
||||
"version": "10.2.0-beta+6V58"
|
||||
},
|
||||
"needs": [ {
|
||||
"need": {
|
||||
|
|
|
@ -16,3 +16,8 @@ PM_DialogueOnSectionsOnly
|
|||
PM_NotAnAboutTopic
|
||||
PM_UnrecognisedAboutTopic
|
||||
PM_UnrecognisedBeatProperty
|
||||
PM_LineToUnknown
|
||||
PM_LineToNonObject
|
||||
PM_AmbiguousPerformanceStyle
|
||||
PM_NonspokenPerformanceStyle
|
||||
PM_LineInUnknownPerformanceStyle
|
||||
|
|
11
inform7/Tests/Test Problems/PM_AmbiguousPerformanceStyle.txt
Normal file
11
inform7/Tests/Test Problems/PM_AmbiguousPerformanceStyle.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
Elsinore is a room. The paranormal is here. Horatio is here.
|
||||
|
||||
Spoken rapidly is a performance style.
|
||||
|
||||
Spoken after somebody else is a performance style.
|
||||
|
||||
Section 1 - Meeting (dialogue)
|
||||
|
||||
(About the paranormal.)
|
||||
|
||||
Horatio: "'Tis but our fantasy."
|
|
@ -0,0 +1,11 @@
|
|||
Elsinore is a room. The paranormal is here. Horatio is here.
|
||||
|
||||
Spoken rapidly is a performance style.
|
||||
|
||||
Section 1 - Meeting (dialogue)
|
||||
|
||||
(About the paranormal.)
|
||||
|
||||
Horatio (rapidly): "'Tis but our fantasy."
|
||||
|
||||
Horatio (oddly): "'Tis but our fantasy."
|
9
inform7/Tests/Test Problems/PM_LineToNonObject.txt
Normal file
9
inform7/Tests/Test Problems/PM_LineToNonObject.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
Elsinore is a room. Horatio and Marcellus are here.
|
||||
|
||||
Section 1 - Meeting (dialogue)
|
||||
|
||||
(About Marcellus.)
|
||||
|
||||
Marcellus (to Horatio): "What, has this thing appear'd again to-night?"
|
||||
|
||||
Marcellus (to 150): "I have seen naught."
|
9
inform7/Tests/Test Problems/PM_LineToUnknown.txt
Normal file
9
inform7/Tests/Test Problems/PM_LineToUnknown.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
Elsinore is a room. Horatio and Marcellus are here.
|
||||
|
||||
Section 1 - Meeting (dialogue)
|
||||
|
||||
(About Marcellus.)
|
||||
|
||||
Marcellus (to Horatio): "What, has this thing appear'd again to-night?"
|
||||
|
||||
Marcellus (to Tinkerbell): "I have seen naught."
|
11
inform7/Tests/Test Problems/PM_NonspokenPerformanceStyle.txt
Normal file
11
inform7/Tests/Test Problems/PM_NonspokenPerformanceStyle.txt
Normal file
|
@ -0,0 +1,11 @@
|
|||
Elsinore is a room. The paranormal is here. Horatio is here.
|
||||
|
||||
Spoken rapidly is a performance style.
|
||||
|
||||
Hastily is a performance style.
|
||||
|
||||
Section 1 - Meeting (dialogue)
|
||||
|
||||
(About the paranormal.)
|
||||
|
||||
Horatio: "'Tis but our fantasy."
|
|
@ -0,0 +1,11 @@
|
|||
Inform 7 v10.2.0 has started.
|
||||
I've now read your source text, which is 38 words long.
|
||||
I've also read Basic Inform by Graham Nelson, which is 7691 words long.
|
||||
I've also read English Language by Graham Nelson, which is 2328 words long.
|
||||
I've also read Standard Rules by Graham Nelson, which is 32205 words long.
|
||||
Problem__ PM_AmbiguousPerformanceStyle
|
||||
>--> The sentence 'Spoken after somebody else is a performance style' (source
|
||||
text, line 5) creates a performance style which would have to be used by
|
||||
marking a line as '(after somebody else)', but that already has a meaning
|
||||
as a line annotation, so this would be ambiguous. Call it something else?
|
||||
Inform 7 has finished.
|
|
@ -0,0 +1,11 @@
|
|||
Inform 7 v10.2.0 has started.
|
||||
I've now read your source text, which is 37 words long.
|
||||
I've also read Basic Inform by Graham Nelson, which is 7691 words long.
|
||||
I've also read English Language by Graham Nelson, which is 2328 words long.
|
||||
I've also read Standard Rules by Graham Nelson, which is 32205 words long.
|
||||
Problem__ PM_LineInUnknownPerformanceStyle
|
||||
In Section 1 - Meeting:
|
||||
>--> The dialogue line 'Horatio (oddly): "'Tis but our fantasy."' (source
|
||||
text, line 11) is apparently spoken in the style 'oddly', but that doesn't
|
||||
seem to correspond to any style I know of.
|
||||
Inform 7 has finished.
|
|
@ -0,0 +1,11 @@
|
|||
Inform 7 v10.2.0 has started.
|
||||
I've now read your source text, which is 33 words long.
|
||||
I've also read Basic Inform by Graham Nelson, which is 7691 words long.
|
||||
I've also read English Language by Graham Nelson, which is 2328 words long.
|
||||
I've also read Standard Rules by Graham Nelson, which is 32205 words long.
|
||||
Problem__ PM_LineToNonObject
|
||||
In Section 1 - Meeting:
|
||||
>--> The dialogue line 'Marcellus (to 150): "I have seen naught."' (source
|
||||
text, line 9) is apparently spoken to '150', but that seems to describe a
|
||||
number, not an object.
|
||||
Inform 7 has finished.
|
|
@ -0,0 +1,11 @@
|
|||
Inform 7 v10.2.0 has started.
|
||||
I've now read your source text, which is 33 words long.
|
||||
I've also read Basic Inform by Graham Nelson, which is 7691 words long.
|
||||
I've also read English Language by Graham Nelson, which is 2328 words long.
|
||||
I've also read Standard Rules by Graham Nelson, which is 32205 words long.
|
||||
Problem__ PM_LineToUnknown
|
||||
In Section 1 - Meeting:
|
||||
>--> The dialogue line 'Marcellus (to Tinkerbell): "I have seen naught."' (source
|
||||
text, line 9) is apparently spoken to 'Tinkerbell', but that isn't
|
||||
something I recognise as the name of a thing or person.
|
||||
Inform 7 has finished.
|
|
@ -0,0 +1,10 @@
|
|||
Inform 7 v10.2.0 has started.
|
||||
I've now read your source text, which is 35 words long.
|
||||
I've also read Basic Inform by Graham Nelson, which is 7691 words long.
|
||||
I've also read English Language by Graham Nelson, which is 2328 words long.
|
||||
I've also read Standard Rules by Graham Nelson, which is 32205 words long.
|
||||
Problem__ PM_NonspokenPerformanceStyle
|
||||
>--> The sentence 'Hastily is a performance style' (source text, line 5)
|
||||
creates a performance style called 'Hastily', but all performance style
|
||||
names have to begin with 'spoken' (for example, 'spoken quickly').
|
||||
Inform 7 has finished.
|
|
@ -163,7 +163,9 @@ of the following possibilities:
|
|||
@e TO_DLC
|
||||
@e WITHOUT_SPEAKING_DLC
|
||||
@e ENDING_DLC
|
||||
@e ENDING_IN_DLC
|
||||
@e ENDING_SAYING_DLC
|
||||
@e ENDING_FINALLY_DLC
|
||||
@e ENDING_FINALLY_SAYING_DLC
|
||||
@e STYLE_DLC
|
||||
|
||||
@<Look for a line name@> =
|
||||
|
@ -188,34 +190,39 @@ of the following possibilities:
|
|||
|
||||
=
|
||||
<dialogue-line-clause> ::=
|
||||
this is the { ... line } | ==> { LINE_NAME_DLC, - }
|
||||
mentioning ... | ==> { MENTIONING_DLC, - }
|
||||
if ... | ==> { IF_DLC, - }
|
||||
unless ... | ==> { UNLESS_DLC, - }
|
||||
before ... | ==> { BEFORE_DLC, - }
|
||||
after ... | ==> { AFTER_DLC, - }
|
||||
to ... | ==> { TO_DLC, - }
|
||||
now ... | ==> { NOW_DLC, - }
|
||||
without speaking | ==> { WITHOUT_SPEAKING_DLC, - }
|
||||
ending the story | ==> { ENDING_DLC, - }
|
||||
ending the story in ... | ==> { ENDING_IN_DLC, - }
|
||||
... ==> { STYLE_DLC, - }
|
||||
this is the { ... line } | ==> { LINE_NAME_DLC, - }
|
||||
mentioning ... | ==> { MENTIONING_DLC, - }
|
||||
if ... | ==> { IF_DLC, - }
|
||||
unless ... | ==> { UNLESS_DLC, - }
|
||||
before ... | ==> { BEFORE_DLC, - }
|
||||
after ... | ==> { AFTER_DLC, - }
|
||||
to ... | ==> { TO_DLC, - }
|
||||
now ... | ==> { NOW_DLC, - }
|
||||
without speaking | ==> { WITHOUT_SPEAKING_DLC, - }
|
||||
ending the story | ==> { ENDING_DLC, - }
|
||||
ending the story finally | ==> { ENDING_FINALLY_DLC, - }
|
||||
ending the story saying <quoted-text> | ==> { ENDING_SAYING_DLC, - }
|
||||
ending the story finally | ==> { ENDING_FINALLY_DLC, - }
|
||||
ending the story finally saying <quoted-text> | ==> { ENDING_FINALLY_SAYING_DLC, - }
|
||||
... ==> { STYLE_DLC, - }
|
||||
|
||||
@ =
|
||||
void DialogueLines::write_dlc(OUTPUT_STREAM, int c) {
|
||||
switch(c) {
|
||||
case LINE_NAME_DLC: WRITE("LINE_NAME"); break;
|
||||
case IF_DLC: WRITE("IF"); break;
|
||||
case UNLESS_DLC: WRITE("UNLESS"); break;
|
||||
case BEFORE_DLC: WRITE("BEFORE"); break;
|
||||
case AFTER_DLC: WRITE("AFTER"); break;
|
||||
case NOW_DLC: WRITE("NOW"); break;
|
||||
case TO_DLC: WRITE("TO"); break;
|
||||
case WITHOUT_SPEAKING_DLC: WRITE("WITHOUT_SPEAKING"); break;
|
||||
case ENDING_DLC: WRITE("ENDING"); break;
|
||||
case ENDING_IN_DLC: WRITE("ENDING_IN"); break;
|
||||
case STYLE_DLC: WRITE("STYLE"); break;
|
||||
default: WRITE("?"); break;
|
||||
case LINE_NAME_DLC: WRITE("LINE_NAME"); break;
|
||||
case IF_DLC: WRITE("IF"); break;
|
||||
case UNLESS_DLC: WRITE("UNLESS"); break;
|
||||
case BEFORE_DLC: WRITE("BEFORE"); break;
|
||||
case AFTER_DLC: WRITE("AFTER"); break;
|
||||
case NOW_DLC: WRITE("NOW"); break;
|
||||
case TO_DLC: WRITE("TO"); break;
|
||||
case WITHOUT_SPEAKING_DLC: WRITE("WITHOUT_SPEAKING"); break;
|
||||
case ENDING_DLC: WRITE("ENDING"); break;
|
||||
case ENDING_SAYING_DLC: WRITE("ENDING_SAYING"); break;
|
||||
case ENDING_FINALLY_DLC: WRITE("ENDING_FINALLY"); break;
|
||||
case ENDING_FINALLY_SAYING_DLC: WRITE("ENDING_FINALLY_SAYING"); break;
|
||||
case STYLE_DLC: WRITE("STYLE"); break;
|
||||
default: WRITE("?"); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -295,25 +302,26 @@ void DialogueLines::decide_line_mentions(void) {
|
|||
instance *DialogueLines::parse_interlocutor(wording CW) {
|
||||
if (<s-type-expression-uncached>(CW)) {
|
||||
parse_node *desc = <<rp>>;
|
||||
kind *K = Specifications::to_kind(desc);
|
||||
if (Kinds::Behaviour::is_subkind_of_object(K)) {
|
||||
LOG("To $T\n", desc);
|
||||
return NULL;
|
||||
} else {
|
||||
Problems::quote_source(1, current_sentence);
|
||||
Problems::quote_wording(2, CW);
|
||||
Problems::quote_kind(3, K);
|
||||
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(...));
|
||||
Problems::issue_problem_segment(
|
||||
"The dialogue line %1 is apparently spoken to '%2', but that "
|
||||
"seems to describe %3, not an object.");
|
||||
Problems::issue_problem_end();
|
||||
return NULL;
|
||||
instance *I = Rvalues::to_instance(desc);
|
||||
if (I) {
|
||||
kind *K = Instances::to_kind(I);
|
||||
if (Kinds::Behaviour::is_object(K)) return I;
|
||||
}
|
||||
kind *K = Specifications::to_kind(desc);
|
||||
LOG("Interlocutor parsed as $T\n", desc);
|
||||
Problems::quote_source(1, current_sentence);
|
||||
Problems::quote_wording(2, CW);
|
||||
Problems::quote_kind(3, K);
|
||||
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_LineToNonObject));
|
||||
Problems::issue_problem_segment(
|
||||
"The dialogue line %1 is apparently spoken to '%2', but that "
|
||||
"seems to describe %3, not an object.");
|
||||
Problems::issue_problem_end();
|
||||
return NULL;
|
||||
} else {
|
||||
Problems::quote_source(1, current_sentence);
|
||||
Problems::quote_wording(2, CW);
|
||||
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(...));
|
||||
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_LineToUnknown));
|
||||
Problems::issue_problem_segment(
|
||||
"The dialogue line %1 is apparently spoken to '%2', but that "
|
||||
"isn't something I recognise as the name of a thing or person.");
|
||||
|
|
|
@ -38,6 +38,7 @@ int PerformanceStyles::new_named_instance_notify(instance *I) {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
@ =
|
||||
parse_node *PerformanceStyles::rvalue_from_performance_style(performance_style *val) { CONV_FROM(performance_style, K_performance_style) }
|
||||
performance_style *PerformanceStyles::rvalue_to_performance_style(parse_node *spec) { CONV_TO(performance_style) }
|
||||
|
||||
|
@ -79,6 +80,7 @@ void PerformanceStyles::write_constant_performance_style_ANNOT(text_stream *OUT,
|
|||
=
|
||||
typedef struct performance_style {
|
||||
struct instance *as_instance; /* the constant for the name of the style */
|
||||
struct wording stem_of_name;
|
||||
CLASS_DEFINITION
|
||||
} performance_style;
|
||||
|
||||
|
@ -102,12 +104,40 @@ void PerformanceStyles::new(instance *I) {
|
|||
performance_style *ps = CREATE(performance_style);
|
||||
@<Connect the performance style structure to the instance@>;
|
||||
@<Initialise the performance style structure@>;
|
||||
wording N = Instances::get_name(I, FALSE);
|
||||
if (<performance-style-name-convention>(N)) {
|
||||
ps->stem_of_name = GET_RW(<performance-style-name-convention>, 1);
|
||||
if ((<dialogue-line-clause>(ps->stem_of_name)) && (<<r>> != STYLE_DLC)) {
|
||||
Problems::quote_source(1, current_sentence);
|
||||
Problems::quote_wording(2, ps->stem_of_name);
|
||||
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_AmbiguousPerformanceStyle));
|
||||
Problems::issue_problem_segment(
|
||||
"The sentence %1 creates a performance style which would have "
|
||||
"to be used by marking a line as '(%2)', but that already has "
|
||||
"a meaning as a line annotation, so this would be ambiguous. "
|
||||
"Call it something else?");
|
||||
Problems::issue_problem_end();
|
||||
}
|
||||
} else {
|
||||
Problems::quote_source(1, current_sentence);
|
||||
Problems::quote_wording(2, N);
|
||||
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_NonspokenPerformanceStyle));
|
||||
Problems::issue_problem_segment(
|
||||
"The sentence %1 creates a performance style called '%2', "
|
||||
"but all performance style names have to begin with 'spoken' "
|
||||
"(for example, 'spoken quickly').");
|
||||
Problems::issue_problem_end();
|
||||
}
|
||||
}
|
||||
|
||||
@ A performance style begins with two ends, 0 (beginning) and 1 (standard end).
|
||||
@ =
|
||||
<performance-style-name-convention> ::=
|
||||
spoken ...
|
||||
|
||||
@
|
||||
|
||||
@<Initialise the performance style structure@> =
|
||||
;
|
||||
ps->stem_of_name = EMPTY_WORDING;
|
||||
|
||||
@ This is a style name which Inform provides special support for; it recognises
|
||||
the English name, so there is no need to translate this to other languages.
|
||||
|
@ -149,9 +179,15 @@ performance_style *PerformanceStyles::parse_style(wording CW) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
performance_style *ps;
|
||||
LOOP_OVER(ps, performance_style)
|
||||
if (Wordings::match(CW, ps->stem_of_name))
|
||||
return ps;
|
||||
|
||||
Problems::quote_source(1, current_sentence);
|
||||
Problems::quote_wording(2, CW);
|
||||
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(...));
|
||||
StandardProblems::handmade_problem(Task::syntax_tree(), _p_(PM_LineInUnknownPerformanceStyle));
|
||||
Problems::issue_problem_segment(
|
||||
"The dialogue line %1 is apparently spoken in the style '%2', but that "
|
||||
"doesn't seem to correspond to any style I know of.");
|
||||
|
|
Loading…
Reference in a new issue