Dialogue Punctuation
version 3 by Ron Newcomb
Section 2 - Implementation Details
The dialogue punctuation extension is a truth state that varies. The dialogue punctuation extension is usually false.
The currently speaking character is an object [a person, or nothing] that varies.
The previously attributed character is an object [a person, or nothing] that varies.
Outside-quotes is a truth state that varies. Outside-quotes is usually true.
An oldline is a truth state that varies. An oldline is usually false. [ an oldline, as opposed to a newline ]
To end dialogue: if inside quotes, say "[close quote 9]"; if oldline is true begin; say speaker break; now oldline is false; end if; say run paragraph on.
Before reading a command (this is the finish dialogue quoting rule): say run paragraph on; end dialogue.
After reading a command (this is the start dialogue quoting rule): now the previously attributed character is nothing; now the currently speaking character is nothing.
To say (character - a person) speaking:
now the dialogue punctuation extension is true;
if character is not the currently speaking character begin; [this closes an existing quote, linebreaks, re-opens a new one]
if inside quotes, say "[run paragraph on][close quote 6]"; [coming after the command line, this will be false]
say "[if the currently speaking character is not nothing][speaker break][end if][indentation][open quote 1]";
now the currently speaking character is the character;
now oldline is true;
otherwise if outside quotes;
say "[open quote 2][run paragraph on]";
now oldline is true;
otherwise if oldline is true;
say sentence break;
end if.
To say says (character - a person):
if character is not the previously attributed character begin;
say "[run paragraph on][close quote 7] says [character].[run paragraph on][sentence break][run paragraph on]";
now the previously attributed character is the character;
now the currently speaking character is the character;
now oldline is true;
otherwise;
say run paragraph on;
end if.
To say c[omma] says (character - a person): [ This just calls the above function if attrib is needed ]
if character is not the previously attributed character, say ",[says character]";
otherwise say ".[run paragraph on]";
now oldline is true.
To say (character - a person) says:
now the dialogue punctuation extension is true;
if character is not the previously attributed character begin;
if inside quotes, say "[run paragraph on][close quote 8][sentence break]";
if the currently speaking character is not nothing and the currently speaking character is not the character, say "[speaker break][indentation]";
say "[if the currently speaking character is nothing][indentation][end if]";
say "[Character] says, [open quote 3][run paragraph on]";
now the previously attributed character is the character;
now the currently speaking character is the character;
now oldline is true;
otherwise if oldline is true;
say sentence break;
end if.
[To (character - a person) says (t - some text):
say "[character speaking][t][run paragraph on]". ] [ No workie: I7 complains that variable & table entry substitutions would be invalid "later", even though I'm not assigning the string to a variable ]
[To say rpo: (- I7_RunOnParagraph(true); -).] [ No workie: I6 still sticks in the new_line beforehand. And I can't REPLACE the new_line function, either. ]
Dialogue Punctuation ends here.