Added emoji support for identifiers

This commit is contained in:
Erin 2022-07-02 00:47:09 +02:00 committed by ondra05
parent 2c04ebbadc
commit 6d37825671

View file

@ -104,7 +104,7 @@ pub enum Token {
/// Run at the end of the program
#[token("finally")]
Finally,
/// Crash with random error (see discussion #17)
#[token("rlyeh")]
Rlyeh,
@ -126,7 +126,7 @@ pub enum Token {
Char(char),
/// An identifier
#[regex(r"\p{XID_Start}[\p{XID_Continue}]+", get_ident)]
#[regex(r"[\p{XID_Start}|\p{Emoji}][\p{XID_Continue}|\p{Emoji}]+", get_ident)]
#[token("and ", |_| "and".to_owned())]
Identifier(String),