feat: simple support for comments
This commit is contained in:
1 parent
d70b436157
commit
a825cdcf58
7 files changed
+218
-51
No files matched your search
@@ -1,10 +1,10 @@
|
||||
use super::*;
|
||||
|
||||
use proc_macro2::TokenStream as TokenStream2;
|
||||
use proc_macro2::{Span, TokenStream as TokenStream2};
|
||||
use quote::{quote, ToTokens, TokenStreamExt};
|
||||
use syn::{
|
||||
parse::{Parse, ParseStream},
|
||||
token, Expr, LitStr, Result,
|
||||
token, Expr, LitStr, Result, spanned::Spanned,
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -27,6 +27,15 @@ impl BodyNode {
|
||||
pub fn is_litstr(&self) -> bool {
|
||||
matches!(self, BodyNode::Text(_))
|
||||
}
|
||||
|
||||
pub fn span(&self) -> Span {
|
||||
match self {
|
||||
BodyNode::Element(el) => el.name.span(),
|
||||
BodyNode::Component(component) => component.name.span(),
|
||||
BodyNode::Text(text) => text.span(),
|
||||
BodyNode::RawExpr(exp) => exp.span(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Parse for BodyNode {
|
||||
|
||||
Reference in new issue
Block a user