trailofbits / pasta

Peter's Amazing Syntax Tree Analyzer
Apache License 2.0
123 stars 9 forks source link

Add `TokenRange::From()` to build token ranges #88

Closed PappasBrent closed 1 year ago

PappasBrent commented 1 year ago

Adds a static method to TokenRange for building token ranges from arbitrary tokens

pgoodman commented 1 year ago

@pgoodman Do you think I should make the return type an optional and return nullopt if begin > end ?

@PappasBrent yes. And you should check that the underlying AST pointers of the two tokens match.