fix: even better comment handling
This commit is contained in:
1 parent
47f3cc2529
commit
4471ccba49
8 files changed
+115
-73
No files matched your search
@@ -1,6 +1,6 @@
|
||||
use super::*;
|
||||
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
use proc_macro2::{Span, TokenStream as TokenStream2};
|
||||
use quote::{quote, ToTokens, TokenStreamExt};
|
||||
use syn::{
|
||||
parse::{Parse, ParseBuffer, ParseStream},
|
||||
@@ -209,7 +209,18 @@ pub enum ElementAttr {
|
||||
/// onclick: {}
|
||||
EventTokens { name: Ident, tokens: Expr },
|
||||
}
|
||||
|
||||
impl ElementAttr {
|
||||
pub fn start(&self) -> Span {
|
||||
match self {
|
||||
ElementAttr::AttrText { name, .. } => name.span(),
|
||||
ElementAttr::AttrExpression { name, .. } => name.span(),
|
||||
ElementAttr::CustomAttrText { name, .. } => name.span(),
|
||||
ElementAttr::CustomAttrExpression { name, .. } => name.span(),
|
||||
ElementAttr::EventTokens { name, .. } => name.span(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_expr(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
|
||||
Reference in new issue
Block a user