Access non-public group API in a way that makes it more clearly non-public

This commit is contained in:
David Tolnay 2022-06-18 17:23:15 -07:00
parent 19b3f0b535
commit 0000e6e911
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 7 additions and 6 deletions

View File

@ -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(

View File

@ -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
@ -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
@ -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

View File

@ -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;