Pull in RustPython parser (#6099)

This commit is contained in:
Micha Reiser 2023-07-27 11:29:11 +02:00 committed by GitHub
parent 86539c1fc5
commit 40f54375cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
779 changed files with 108400 additions and 2078 deletions

View file

@ -0,0 +1,15 @@
use unic_ucd_category::GeneralCategory;
/// According to python following categories aren't printable:
/// * Cc (Other, Control)
/// * Cf (Other, Format)
/// * Cs (Other, Surrogate)
/// * Co (Other, Private Use)
/// * Cn (Other, Not Assigned)
/// * Zl Separator, Line ('\u2028', LINE SEPARATOR)
/// * Zp Separator, Paragraph ('\u2029', PARAGRAPH SEPARATOR)
/// * Zs (Separator, Space) other than ASCII space('\x20').
pub fn is_printable(c: char) -> bool {
let cat = GeneralCategory::of(c);
!(cat.is_other() || cat.is_separator())
}