Skip to content

Commit

Permalink
Update regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilia-Kosenkov committed Aug 4, 2024
1 parent 7391b1f commit e99ac3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/find_exports.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extract_meta <- function(lns) {
# Matches fn|impl<'a> item_name
result <- stringi::stri_match_first_regex(
glue_collapse(lns, sep = "\n"),
"(?:(fn)|(impl)(?:\\s*<(.+?)>)?)\\s+(_\\w+|[A-z]\\w*)"
"(?:(?<fn>fn)|(?<impl>impl)(?:\\s*<(?<lifetime>.+?)>)?)\\s+(?<name>(?:r#)?(?:_\\w+|[A-z]\\w*))"
) %>%
tibble::as_tibble(.name_repair = "minimal") %>%
rlang::set_names(c("match", "fn", "impl", "lifetime", "name")) %>%
Expand Down

0 comments on commit e99ac3a

Please sign in to comment.