Skip to content

Commit

Permalink
Access non-public group API in a way that makes it more clearly non-p…
Browse files Browse the repository at this point in the history
…ublic
  • Loading branch information
dtolnay committed Jun 19, 2022
1 parent 19b3f0b commit 0000e6e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ pub extern crate quote;

pub use proc_macro2::{Span, TokenStream as TokenStream2};

#[cfg(feature = "parsing")]
pub use crate::group::{parse_braces, parse_brackets, parse_parens};

pub use crate::span::IntoSpans;

#[cfg(all(
Expand Down
6 changes: 3 additions & 3 deletions src/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ fn parse_delimited<'a>(
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
macro_rules! parenthesized {
($content:ident in $cursor:expr) => {
match $crate::group::parse_parens(&$cursor) {
match $crate::__private::parse_parens(&$cursor) {
$crate::__private::Ok(parens) => {
$content = parens.content;
parens.token
Expand Down Expand Up @@ -214,7 +214,7 @@ macro_rules! parenthesized {
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
macro_rules! braced {
($content:ident in $cursor:expr) => {
match $crate::group::parse_braces(&$cursor) {
match $crate::__private::parse_braces(&$cursor) {
$crate::__private::Ok(braces) => {
$content = braces.content;
braces.token
Expand Down Expand Up @@ -269,7 +269,7 @@ macro_rules! braced {
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
macro_rules! bracketed {
($content:ident in $cursor:expr) => {
match $crate::group::parse_brackets(&$cursor) {
match $crate::__private::parse_brackets(&$cursor) {
$crate::__private::Ok(brackets) => {
$content = brackets.content;
brackets.token
Expand Down
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,9 @@ extern crate quote;
#[macro_use]
mod macros;

// Not public API.
#[cfg(feature = "parsing")]
#[doc(hidden)]
#[macro_use]
pub mod group;
mod group;

#[macro_use]
pub mod token;
Expand Down

0 comments on commit 0000e6e

Please sign in to comment.