He makes the edit on his piece of paper before trying to match the
pattern in the next instruction. Remember, the scrivener has to read
through a series of instructions, and he reads all of them, not just
the first instruction that matches the pattern. Because he makes his
edits as he goes, he is always trying to match the latest version
against the next pattern; he doesn't remember the
original line.
When he gets to the bottom of the list of instructions, and has made
any edits that were necessary on his piece of paper, he goes into the
next room to copy out the line. (He doesn't need to
be told to print out the line.) After that is done, he returns to the
first room and takes down the next line on a new scrap of paper. When
he goes to the second room, once again he reads every instruction
from first to last before leaving.
Let's look at other kinds of instructions the
scrivener has to interpret. First of all, an instruction can have
zero, one, or two patterns specified:
-
If no pattern is specified, the same procedure is followed for each
line.
-
If there is only one pattern, he will follow the procedure for any
line matching the pattern.
-
If a pattern is followed by a !, the procedure is
followed for all lines that do not match the
pattern.
-
If two patterns are specified, the actions described in the procedure
are performed on the first matching line and all succeeding lines
until a line matches the second pattern.
The scrivener can work on only one line at a time, so you might
wonder how he handles a range of lines. Each time he goes through the
instructions, he tries to match only the first of two patterns. Now,
after he has found a line that matches the first pattern, each time
through with a new line he tries to match the second pattern. He
interprets the second pattern as
pattern!, so that the
procedure is followed only if there is no match. When the second
pattern is matched, he starts looking again for the first pattern.