Jun-05-2022, 04:07 PM
(Jun-05-2022, 03:12 PM)Gribouillis Wrote: The idea of building an order relation for the regular expressions looks creative. What are you going to do with this order relation?Just for a bit of a fun (and also to use for another project) I felt like recreating the Rust logos crate to be able to create custom lexers. I know there exist already many python modules to do this I just felt recreating this would be fun.
Logos uses a priority system to determine the priority of the tokens that you defined, which includes parsing regexes into an AST to define a priority for them. I feel like making my python as close to logos as possible so I wanted to do that too, hence the reason to get an AST that is a bit easier to work with.