pub trait CharExt {
    // Required methods
    fn is_identifier_start(&self) -> bool;
    fn is_identifier_continue(&self) -> bool;
}
Expand description

Extension methods for char.

These methods assume that all identifiers are ASCII. This is not actually the case for Rust, which identifiers follow the specification in Unicode Standard Annex #31. We intend to implement this properly in the future, but doing so requires generating several large Unicode character tables, which why we’ve held off from this for now.

Required Methods§

source

fn is_identifier_start(&self) -> bool

Checks if char is the start of an identifier.

source

fn is_identifier_continue(&self) -> bool

Checks if char is the continuation of an identifier.

Note that this method assumes all identifiers are ASCII.

Implementations on Foreign Types§

source§

impl CharExt for char

Implementors§