| | 2 | |
| | 3 | == CodeString == |
| | 4 | |
| | 5 | The CodeString PMC has been removed |
| | 6 | |
| | 7 | === Rationale === |
| | 8 | |
| | 9 | Equivalent and more efficient functionality is available from StringBuilder. |
| | 10 | |
| | 11 | === Replacement === |
| | 12 | |
| | 13 | CodeString contains a number of convenience methods in addition to its core functionality. It is easier to replace these first. |
| | 14 | |
| | 15 | * CodeString.lineof can be replaced by PGE;Util;line_number |
| | 16 | * CodeString.unique can be replaced by PGE;Util;unique, PAST;Compiler;unique, or PAST;Compiler;uniquereg |
| | 17 | * CodeString.escape can be replaced by PGE;Util;pir_str_escape |
| | 18 | * CodeString.key can be replaced by PGE;Util;pir_key_escape |
| | 19 | * CodeString.charname_to_ord can be replaced by the find_codepoint opcode |
| | 20 | |
| | 21 | After these replacements, StringBuilder can be substituted for CodeString by changing .emit to .append_format. append_format does not add newlines, so these must be added to the format string. |