Skip to content

Commit

Permalink
Merge pull request #5633 from gridbugs/expose-string_interp_regex
Browse files Browse the repository at this point in the history
Expose string_interp_regex
  • Loading branch information
kit-ty-kate committed Aug 15, 2023
2 parents 478d105 + 47c6532 commit 2fcce29
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,7 @@ users)
* Add `OpamFilter.expand_interpolations_in_file_full` which allows setting the
output file along with the input file [#5629 @rgrinberg]

* Expose `OpamFilter.string_interp_regex` which allows clients to identify
variable interpolations in strings [#5633 @gridbugs]

## opam-core
4 changes: 4 additions & 0 deletions src/format/opamFilter.mli
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ val fold_down_left: ('a -> filter -> 'a) -> 'a -> filter -> 'a
(** Maps on all nodes of a filter, bottom-up *)
val map_up: (filter -> filter) -> filter -> filter

(** Regex matching string interpolation syntax (["%%"], ["%{xxx}%"], or
["%{xxx"] if unclosed) *)
val string_interp_regex : Re.re

(** Returns all the variables appearing in a filter (including the ones within
string interpolations *)
val variables: filter -> full_variable list
Expand Down

0 comments on commit 2fcce29

Please sign in to comment.