feat: simple support for comments

This commit is contained in:
Jonathan Kelley committed 2022-06-28 15:01:51 -04:00
1 parent d70b436157
commit a825cdcf58
7 files changed
+218 -51

No files matched your search

+11 -2
View File
@@ -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 {