swc_ecma_parser::lexer::util

Trait CharExt

Source
pub trait CharExt: Copy {
    // Required method
    fn to_char(self) -> Option<char>;

    // Provided methods
    fn is_ident_start(self) -> bool { ... }
    fn is_ident_part(self) -> bool { ... }
    fn is_line_terminator(self) -> bool { ... }
    fn is_line_break(self) -> bool { ... }
    fn is_ws(self) -> bool { ... }
}
Expand description

Implemented for char.

Required Methods§

Provided Methods§

Source

fn is_ident_start(self) -> bool

Test whether a given character code starts an identifier.

https://tc39.github.io/ecma262/#prod-IdentifierStart

Source

fn is_ident_part(self) -> bool

Test whether a given character is part of an identifier.

Source

fn is_line_terminator(self) -> bool

See https://tc39.github.io/ecma262/#sec-line-terminators

Source

fn is_line_break(self) -> bool

See https://tc39.github.io/ecma262/#sec-literals-string-literals

Source

fn is_ws(self) -> bool

See https://tc39.github.io/ecma262/#sec-white-space

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl CharExt for char

Implementors§