Skip to main content

Module copy

Module copy 

Source
Expand description

COPY and COPY REPLACING, applied to the logical text before it is lexed. Matching is by text-words, as the standard defines them, and replacement edits the text itself, so a pseudo-text such as ==:TAG:== can replace part of a word like :TAG:-RECORD.

Structs§

Libraries
Directories searched for COPY members, in order. A COPY X OF LIB looks in <dir>/LIB first. The file being compiled, when named, is never one of its own members. The compliance level is how the program and its members are read.

Functions§

decode
Reads a source file’s bytes: UTF-8 when valid, otherwise one character per byte (Latin-1).
expand
Replaces every COPY statement in source with its member’s text, recursively. files names each source file; a position’s file indexes it.
replace
Applies the REPLACE statements in source, which COPY has expanded (Language Reference SC27-8713-03, pp. 708-712): each one’s operands act on the text from its period to the next REPLACE statement or the end of the source, with COPY REPLACING’s matching, and the statements themselves are left out (assumption C160).