Closed osa1 closed 2 years ago
use lexgen::lexer; use lexgen_util::Loc; lexer! { Lexer -> usize; "'" _ "'" = 1, "'" ['a'-'z']+ = 2, } #[test] fn char_lit() { let input = "'a'"; let mut lexer = Lexer::new(input); // Fails: assert_eq!(lexer.next(), Some(Ok((Loc { line: 0, col: 0, byte_idx: 0 }, 1, Loc { line: 0, col: 3, byte_idx: 3 })))); assert_eq!(lexer.next(), None); }