diff options
| author | Donggyu | 2016-09-25 14:56:46 -0700 |
|---|---|---|
| committer | GitHub | 2016-09-25 14:56:46 -0700 |
| commit | 744ea401553cabfb31c7cc32aecfd8ca2764d1b8 (patch) | |
| tree | 628d4ce1d4bebc228fadd5a74365019f0dc5c62b /src/main/scala/firrtl/StringLit.scala | |
| parent | bd1a3ae2d1130fbfb51ad4ef88349364c931680d (diff) | |
| parent | 2e553ec9859c369938ed035c83040dd80877f893 (diff) | |
Merge pull request #316 from ucb-bar/style-cleanup-take-3
Style cleanup take 3
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)) } } |
