How to parse specific syntax elements and discard the rest?
VegOwOtenks:
What you’re describing sounds very similar to the
find-all-matchesmode of regular expression drivers.
Cool! I didn’t think about making a findAll function. Thanks for the idea.
VegOwOtenks:
Assuming, it’s impossible to mistake your token for another token in the target language if context is missing. E.g. it would be impossible to exclusively find all variable names in Rust code because they overlap with Type Identifiers and more.
That is true. I realized this a while after posting this. When trimming away the first character a non path syntax element might become a valid syntax element, and this is not what I want. Furthermore, I can’t distinguish whether the path I found is in a string literal or not, which is also not what I want. I think I’ll go with the Haskell nix parser route.
Discussion in the ATmosphere