Skip to content

how should I architect a project that maps between regex syntaxes? (should I target Ast or Hir in regex-syntax?) #1167

Answered by BurntSushi
cosmicexplorer asked this question in Q&A
Discussion options

You must be logged in to vote

Aye, just copying my answer here from #962 so that this can be marked as answered. :-) Feel free to edit your comment to remove the other copy hah.


@BurntSushi is that how you would suggest architecting this if I wanted to interface other regexp interfaces to regex-syntax and co?

Maybe? I've never done the exercise before, so I'm not sure. It's plausible the right target is regex-syntax::hir::Hir. Namely, an Hir is perhaps closer to what you might think of as a traditional AST where as an Ast is perhaps closer to a Concrete Syntax Tree. A concrete syntax tree essentially tries to describe the concrete syntax precisely so that it can be round-tripped. This makes it very detailed and pos…

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@cosmicexplorer
Comment options

@BurntSushi
Comment options

@BurntSushi
Comment options

@cosmicexplorer
Comment options

@cosmicexplorer
Comment options

Answer selected by BurntSushi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants