Closed
Description
I was looking through the custom Lexer tutorial, but I'm not really sure how to use the lexer I've written with Lalrpop. In particular, the regular expressions I use are ones that the Regex crate does not (and most likely will not) support; I instead use fancy_regex for those features. However, my Lexer returns types like this:
#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum Token {
Identifier {
line: usize,
column: usize,
value: String,
},
// ...
(It also returns an anyhow::Result<Vec<Token>>
.) What would be the (correct) way of incorporating this lexer into a Lalrpop grammar? (I just have a standalone tokenize
function, though I can change that to a full Lexer
type if that's required.)
Metadata
Metadata
Assignees
Labels
No labels