1 // Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // NOTE: The following code was generated by "src/etc/char_private.py",
12 // do not edit directly!
14 fn check(x: u16, singletons: &[u16], normal: &[u16]) -> bool {
15 for &s in singletons {
22 for w in normal.chunks(2) {
25 let difference = (x as i32) - (start as i32);
27 if difference < len as i32 {
37 pub fn is_printable(x: char) -> bool {
41 check(lower, SINGLETONS0, NORMAL0)
42 } else if x < 0x20000 {
43 check(lower, SINGLETONS1, NORMAL1)
45 if 0x20000 <= x && x < 0x2f800 {
48 if 0x2fa1e <= x && x < 0xe0100 {
51 if 0xe01f0 <= x && x < 0x110000 {
58 const SINGLETONS0: &'static [u16] = &[
346 const SINGLETONS1: &'static [u16] = &[
444 const NORMAL0: &'static [u16] = &[
606 const NORMAL1: &'static [u16] = &[