mirror of
https://github.com/KarolS/millfork.git
synced 2024-11-17 01:07:08 +00:00
Add the {nullchar} escape sequence
This commit is contained in:
parent
1f8ece007b
commit
0be52821d9
@ -69,6 +69,8 @@ Some escape sequences may expand to multiple characters. For example, in several
|
||||
|
||||
* `{program_name_upper}` – the same, but uppercased
|
||||
|
||||
* `{nullchar}` – the null terminator for strings (`"{nullchar}"` is equivalent to `""z`)
|
||||
|
||||
##### Available only in some encodings
|
||||
|
||||
* `{n}` – new line
|
||||
|
@ -116,6 +116,9 @@ class TextCodec(val name: String,
|
||||
if (escSeq == "copyright_year") {
|
||||
return encode(log, position, LocalDate.now.getYear.toString.toList, options, lenient)
|
||||
}
|
||||
if (escSeq == "null" || escSeq == "nullchar") {
|
||||
return List(stringTerminator)
|
||||
}
|
||||
escapeSequences.getOrElse(escSeq, {
|
||||
if (lenient) {
|
||||
log.warn(s"Cannot encode escape sequence {$escSeq} in encoding `$name`, skipped it", position)
|
||||
|
Loading…
Reference in New Issue
Block a user