Next: Formatted Keyword Instances, Previous: Recognized Keywords, Up: Keywords
Keyword replacement is recursive.
Replacement of a keyword takes place on a string which is either the
quoted contents of a Format
keyword or the defined value of a
regular keyword instance. When this string contains an instance of a
keyword which is not currently being replaced, it recursively outputs
the value of that keyword. Processed text is not reexamined. A keyword
instance is not replaced when it is appears during a recursive
replacement of the same keyword, to prevent loops.
One minor glitch in the above description. Since the `$' character delimits keyword instances, tt is necessary to prevent `$' characters from being inserted as the value of a non-formatted keyword. All text after the first `$' would otherwise end up being inserted into the document. For example, if the keyword K had value “I have a `$' character!” were replaced:
$K: I have a $ character!$
Then, the next replacement would result in:
$K: I have a $ character!$ character!$
and so on. Therefore, when spurious `$' characters are found
inside the contents of a regular keyword value (not Format
), they
are replaced with the `|' character.