//! Determine if a `char` is a valid identifier for a parser and/or lexer according to //! [Unicode Standard Annex #31](http://www.unicode.org/reports/tr31/) rules. //! //! ```rust //! use unicode_xid::UnicodeXID; //! //! fn main() { //! assert_eq!(UnicodeXID::is_xid_start('a'), true); // 'a' is a valid start of an identifier //! assert_eq!(UnicodeXID::is_xid_start('△'), false); // '△' is a NOT valid start of an identifier //! } //! ``` //! //! # features //! //! unicode-xid supports a `no_std` feature. This eliminates dependence //! on std, and instead uses equivalent functions from core. //!
use tables::derived_property; pubuse tables::UNICODE_VERSION;
mod tables;
#[cfg(test)] mod tests;
/// Methods for determining if a character is a valid identifier character. pubtrait UnicodeXID { /// Returns whether the specified character satisfies the 'XID_Start' /// Unicode property. /// /// 'XID_Start' is a Unicode Derived Property specified in /// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications), /// mostly similar to ID_Start but modified for closure under NFKx. fn is_xid_start(self) -> bool;
/// Returns whether the specified `char` satisfies the 'XID_Continue' /// Unicode property. /// /// 'XID_Continue' is a Unicode Derived Property specified in /// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications), /// mostly similar to 'ID_Continue' but modified for closure under NFKx. fn is_xid_continue(self) -> bool;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.