diff options
Diffstat (limited to 'src/main/scala/firrtl/StringLit.scala')
| -rw-r--r-- | src/main/scala/firrtl/StringLit.scala | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/scala/firrtl/StringLit.scala b/src/main/scala/firrtl/StringLit.scala index 501e9686..fd282177 100644 --- a/src/main/scala/firrtl/StringLit.scala +++ b/src/main/scala/firrtl/StringLit.scala @@ -79,11 +79,10 @@ trait StringLitHandler { // TODO Finalize supported escapes, implement hex2Bytes //case 0x78 => (4, hex2Bytes(in.slice(2, 3)))) // hex escape //case 0x75 => (6, hex2Bytes(in.slice(2, 5))) // unicode excape - case e => { // error - val msg = s"Invalid escape character ${e.toChar}! " + + case e => // error + val msg = s"Invalid escape character ${e.toChar}! " + "Valid characters [nt'\"\\]" throw new InvalidEscapeCharException(msg) - } } unescape(in.drop(n), out ++ bytes) // consume n } else { @@ -111,11 +110,11 @@ object VerilogStringLitHandler extends StringLitHandler { def format(in: Array[Byte], out: Array[Byte], percent: Boolean): Array[Byte] = { if (in.isEmpty) out else { - if (percent && in.head == 'x') format(in.tail, out :+ 'h'.toByte, false) + if (percent && in.head == 'x') format(in.tail, out :+ 'h'.toByte, percent = false) else format(in.tail, out :+ in.head, in.head == '%' && !percent) } } - StringLit(format(lit.array, Array(), false)) + StringLit(format(lit.array, Array(), percent = false)) } } |
