equal
deleted
inserted
replaced
265 private val (decoder, encoder) = |
265 private val (decoder, encoder) = |
266 { |
266 { |
267 val mapping = |
267 val mapping = |
268 for { |
268 for { |
269 (sym, props) <- symbols |
269 (sym, props) <- symbols |
270 val code = |
270 code = |
271 try { Integer.decode(props("code")).intValue } |
271 try { Integer.decode(props("code")).intValue } |
272 catch { |
272 catch { |
273 case _: NoSuchElementException => error("Missing code for symbol " + sym) |
273 case _: NoSuchElementException => error("Missing code for symbol " + sym) |
274 case _: NumberFormatException => error("Bad code for symbol " + sym) |
274 case _: NumberFormatException => error("Bad code for symbol " + sym) |
275 } |
275 } |
276 val ch = new String(Character.toChars(code)) |
276 ch = new String(Character.toChars(code)) |
277 } yield { |
277 } yield { |
278 if (code < 128) error("Illegal ASCII code for symbol " + sym) |
278 if (code < 128) error("Illegal ASCII code for symbol " + sym) |
279 else (sym, ch) |
279 else (sym, ch) |
280 } |
280 } |
281 (new Recoder(mapping), |
281 (new Recoder(mapping), |