@@ -11,9 +11,9 @@ mod selector_separator;
1111pub mod style_selector;
1212pub mod utils;
1313
14+ use once_cell:: sync:: Lazy ;
1415use std:: collections:: BTreeMap ;
1516use std:: hash:: { DefaultHasher , Hash , Hasher } ;
16- use once_cell:: sync:: Lazy ;
1717use std:: sync:: Mutex ;
1818
1919use crate :: class_map:: GLOBAL_CLASS_MAP ;
@@ -146,13 +146,10 @@ pub fn keyframes_to_keyframes_name(keyframes: &str, filename: Option<&str>) -> S
146146 } ) ;
147147 if !filename. is_empty ( ) {
148148 format ! (
149- "{}{}" ,
149+ "{}{}-{} " ,
150150 prefix,
151- format!(
152- "{}-{}" ,
153- num_to_nm_base( get_file_num_by_filename( & filename) ) ,
154- class_num
155- )
151+ num_to_nm_base( get_file_num_by_filename( & filename) ) ,
152+ class_num
156153 )
157154 } else {
158155 format ! ( "{}{}" , prefix, class_num)
@@ -178,25 +175,22 @@ pub fn sheet_to_classname(
178175 if is_debug ( ) {
179176 let selector = selector. unwrap_or_default ( ) . trim ( ) ;
180177 format ! (
181- "{}{}" ,
178+ "{}{}-{}-{}-{}-{}{} " ,
182179 prefix,
183- format!(
184- "{}-{}-{}-{}-{}{}" ,
185- property. trim( ) ,
186- level,
187- optimize_value( value. unwrap_or_default( ) ) ,
188- if selector. is_empty( ) {
189- "" . to_string( )
190- } else {
191- let mut hasher = DefaultHasher :: new( ) ;
192- selector. hash( & mut hasher) ;
193- hasher. finish( ) . to_string( )
194- } ,
195- style_order. unwrap_or( 255 ) ,
196- filename
197- . map( |v| format!( "-{}" , get_file_num_by_filename( v) ) )
198- . unwrap_or_default( ) ,
199- )
180+ property. trim( ) ,
181+ level,
182+ optimize_value( value. unwrap_or_default( ) ) ,
183+ if selector. is_empty( ) {
184+ "" . to_string( )
185+ } else {
186+ let mut hasher = DefaultHasher :: new( ) ;
187+ selector. hash( & mut hasher) ;
188+ hasher. finish( ) . to_string( )
189+ } ,
190+ style_order. unwrap_or( 255 ) ,
191+ filename
192+ . map( |v| format!( "-{}" , get_file_num_by_filename( v) ) )
193+ . unwrap_or_default( ) ,
200194 )
201195 } else {
202196 let key = format ! (
@@ -225,13 +219,10 @@ pub fn sheet_to_classname(
225219 } ) ;
226220 if !filename. is_empty ( ) {
227221 format ! (
228- "{}{}" ,
222+ "{}{}-{} " ,
229223 prefix,
230- format!(
231- "{}-{}" ,
232- num_to_nm_base( get_file_num_by_filename( & filename) ) ,
233- clas_num
234- )
224+ num_to_nm_base( get_file_num_by_filename( & filename) ) ,
225+ clas_num
235226 )
236227 } else {
237228 format ! ( "{}{}" , prefix, clas_num)
@@ -244,20 +235,17 @@ pub fn sheet_to_variable_name(property: &str, level: u8, selector: Option<&str>)
244235 if is_debug ( ) {
245236 let selector = selector. unwrap_or_default ( ) . trim ( ) ;
246237 format ! (
247- "--{}{}" ,
238+ "--{}{}-{}-{} " ,
248239 prefix,
249- format!(
250- "{}-{}-{}" ,
251- property,
252- level,
253- if selector. is_empty( ) {
254- "" . to_string( )
255- } else {
256- let mut hasher = DefaultHasher :: new( ) ;
257- selector. hash( & mut hasher) ;
258- hasher. finish( ) . to_string( )
259- }
260- )
240+ property,
241+ level,
242+ if selector. is_empty( ) {
243+ "" . to_string( )
244+ } else {
245+ let mut hasher = DefaultHasher :: new( ) ;
246+ selector. hash( & mut hasher) ;
247+ hasher. finish( ) . to_string( )
248+ }
261249 )
262250 } else {
263251 let key = format ! (
0 commit comments