Skip to content

Commit 0909afd

Browse files
committed
Normalize prefix for exported but not-really-public names
1 parent 7f9e876 commit 0909afd

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

macros/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::ascii::AsciiExt;
1111

1212
/// Panic if any string contains ASCII uppercase letters.
1313
/// Emit a `MAX_LENGTH` constant with the length of the longest string.
14-
#[proc_macro_derive(cssparser__assert_ascii_lowercase__max_len)]
14+
#[proc_macro_derive(cssparser_internal__assert_ascii_lowercase__max_len)]
1515
pub fn assert_ascii_lowercase_max_len(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
1616
max_len_common(input, |token_trees| {
1717
let tokens = quote!( match x { #( #token_trees )* } );
@@ -47,7 +47,7 @@ pub fn assert_ascii_lowercase_max_len(input: proc_macro::TokenStream) -> proc_ma
4747
}
4848

4949
/// Emit a `MAX_LENGTH` constant with the length of the longest string.
50-
#[proc_macro_derive(cssparser__max_len)]
50+
#[proc_macro_derive(cssparser_internal__max_len)]
5151
pub fn max_len(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
5252
max_len_common(input, |token_trees| {
5353
token_trees.iter().map(|tt| string_literal(tt).len()).max()
@@ -69,7 +69,7 @@ where F : FnOnce(&[syn::TokenTree]) -> Option<usize> {
6969
/// ```
7070
///
7171
/// Map keys are ASCII-lowercased.
72-
#[proc_macro_derive(cssparser__phf_map)]
72+
#[proc_macro_derive(cssparser_internal__phf_map)]
7373
pub fn phf_map(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
7474
common(input, |token_trees| {
7575
let value_type = &token_trees[0];

src/macros.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@
3737
macro_rules! match_ignore_ascii_case {
3838
( $input:expr, $( $match_body:tt )* ) => {
3939
{
40-
_cssparser_internal__pretend_proc_macro! {
41-
cssparser__assert_ascii_lowercase__max_len!( $( $match_body )* )
40+
cssparser_internal__pretend_proc_macro! {
41+
cssparser_internal__assert_ascii_lowercase__max_len!( $( $match_body )* )
4242
}
4343

4444
{
45-
// MAX_LENGTH is generated by cssparser__assert_ascii_lowercase__max_len
46-
_cssparser_internal__to_lowercase!($input, MAX_LENGTH => lowercase);
45+
// MAX_LENGTH is generated by cssparser_internal__assert_ascii_lowercase__max_len
46+
cssparser_internal__to_lowercase!($input, MAX_LENGTH => lowercase);
4747
// "A" is a short string that we know is different for every string pattern,
4848
// since we’ve verified that none of them include ASCII upper case letters.
4949
match lowercase.unwrap_or("A") {
@@ -86,16 +86,16 @@ macro_rules! match_ignore_ascii_case {
8686
macro_rules! ascii_case_insensitive_phf_map {
8787
($name: ident -> $ValueType: ty = { $( $key: expr => $value: expr, )* }) => {
8888
fn $name(input: &str) -> Option<&'static $ValueType> {
89-
_cssparser_internal__pretend_proc_macro! {
90-
cssparser__phf_map!( ($ValueType) $( $key ($value) )+ )
89+
cssparser_internal__pretend_proc_macro! {
90+
cssparser_internal__phf_map!( ($ValueType) $( $key ($value) )+ )
9191
}
9292

9393
{
94-
_cssparser_internal__pretend_proc_macro! {
95-
cssparser__max_len!( $( $key )+ )
94+
cssparser_internal__pretend_proc_macro! {
95+
cssparser_internal__max_len!( $( $key )+ )
9696
}
97-
// MAX_LENGTH is generated by cssparser__max_len
98-
_cssparser_internal__to_lowercase!(input, MAX_LENGTH => lowercase);
97+
// MAX_LENGTH is generated by cssparser_internal__max_len
98+
cssparser_internal__to_lowercase!(input, MAX_LENGTH => lowercase);
9999
lowercase.and_then(|s| MAP.get(s))
100100
}
101101
}
@@ -111,7 +111,7 @@ macro_rules! ascii_case_insensitive_phf_map {
111111
/// with a stack-allocated buffer as long as the longest `$string`.
112112
#[macro_export]
113113
#[doc(hidden)]
114-
macro_rules! _cssparser_internal__to_lowercase {
114+
macro_rules! cssparser_internal__to_lowercase {
115115
($input: expr, $MAX_LENGTH: expr => $output: ident) => {
116116
// mem::uninitialized() is ok because `buffer` is only used in `_internal__to_lowercase`,
117117
// which initializes with `copy_from_slice` the part of the buffer it uses,
@@ -130,7 +130,7 @@ macro_rules! _cssparser_internal__to_lowercase {
130130
/// **This macro is not part of the public API. It can change or be removed between any versions.**
131131
#[macro_export]
132132
#[doc(hidden)]
133-
macro_rules! _cssparser_internal__pretend_proc_macro {
133+
macro_rules! cssparser_internal__pretend_proc_macro {
134134
($macro_name: ident ! ( $($tt: tt)* )) => {
135135
#[derive($macro_name)]
136136
#[allow(unused)]

0 commit comments

Comments
 (0)