posit-dev / ark

Ark, an R kernel
MIT License
159 stars 9 forks source link

Add `SrcRef` type and create srcrefs with `parse_status()` #482

Closed lionel- closed 1 month ago

lionel- commented 1 month ago

Branched from #481.

Add SrcRef type and enable parsing with srcrefs in parse_status(). We now use this in parse_exprs_with_srcrefs() instead of calling back into the R-level parse(). Also adds a bunch of tests to this previously untested area.

Will be useful to write tools that detect expression boundaries in R code. Progress towards posit-dev/positron#1326

Edit: srcref is now a submodule of parser. I'll move parse.rs and source.rs to that submodule outside of this PR.

lionel- commented 1 month ago

@DavisVaughan Can you take another quick look please?