fix: allow duplicate selectors in scope, coz its safe to have them, coz hashing isnt affected by selector position
This commit is contained in:
parent
60fd00beba
commit
09c90b79e8
2 changed files with 68 additions and 11 deletions
|
|
@ -16,6 +16,7 @@ quote = {version = "^1.0"}
|
|||
proc-macro2 = {version = "^1.0", features = ["span-locations"]}
|
||||
raffia = {version = "^0.9"}
|
||||
regex = {version = "^1.11"}
|
||||
itertools = {version = "^0.13"}
|
||||
|
||||
[features]
|
||||
nightly = []
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use std::path::PathBuf;
|
||||
|
||||
use itertools::Itertools;
|
||||
use proc_macro2::{Span, TokenStream};
|
||||
use quote::quote;
|
||||
use sabry_intrnl::{
|
||||
|
|
@ -94,6 +95,7 @@ pub fn styly_macro_impl(input: TokenStream, source_path: Option<PathBuf>) -> Tok
|
|||
interp
|
||||
})
|
||||
})
|
||||
.unique()
|
||||
.map(|s| {
|
||||
let ident = apply_basic_rusty_member_gen_rules(&s);
|
||||
let fnident = syn::parse_str::<Ident>(format!("_{ident}").as_str())
|
||||
|
|
@ -110,6 +112,7 @@ pub fn styly_macro_impl(input: TokenStream, source_path: Option<PathBuf>) -> Tok
|
|||
let scope_members = scope
|
||||
.hashed_selectors
|
||||
.iter()
|
||||
.unique()
|
||||
.filter_map(|hs| {
|
||||
hs.html_ident.clone().map(|html| {
|
||||
let name = match hs.sel {
|
||||
|
|
|
|||
Loading…
Reference in a new issue