mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-27 11:30:19 +00:00
Fix escape sequences
This commit is contained in:
parent
798c49fd34
commit
4abfab41df
@ -187,7 +187,7 @@ class TableTextCodec(override val name: String,
|
||||
val (escSeq, closingBrace) = tail.span(_ != '}')
|
||||
closingBrace match {
|
||||
case '}' :: xs =>
|
||||
encodeEscapeSequence(log, escSeq.mkString(""), position, options, lenient) ++ encode(log, position, xs, options, lenient)
|
||||
encodeEscapeSequence(log, escSeq.map(_.toChar).mkString(""), position, options, lenient) ++ encode(log, position, xs, options, lenient)
|
||||
case _ =>
|
||||
log.error(f"Unclosed escape sequence", position)
|
||||
Nil
|
||||
|
@ -67,4 +67,17 @@ class TextCodecSuite extends FunSuite with Matchers {
|
||||
| }
|
||||
""".stripMargin)
|
||||
}
|
||||
|
||||
test("Escape sequences") {
|
||||
val m = EmuUnoptimizedRun(
|
||||
"""
|
||||
| void main() {
|
||||
| pointer p
|
||||
| p = "{n}"pet
|
||||
| output = p[0]
|
||||
| }
|
||||
| byte output @$c000
|
||||
""".stripMargin)
|
||||
m.readByte(0xc000) should equal(13)
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user