Skip to content

Repeat DOT is no longer forbidden #486

@tisonkun

Description

@tisonkun
use logos::Logos;

#[derive(Logos, Debug, PartialEq)]
enum Token {
    #[regex(r".*")]
    BetweenParen,
}

fn main() {
    let mut lex = Token::lexer("1234");
    println!("{:#?}", lex.next().unwrap());
    println!("{:#?}", lex.span());
}

This can pass compilation now. Produce:

Ok(
    BetweenParen,
)
0..4

If change the regex as .*4, it fails to match (tokenize).

cc @maciejhirsz @jeertmans

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions