Filter out doc comments before calling Lit::new
diff --git a/src/lit.rs b/src/lit.rs
index 0190f27..584ccb9 100644
--- a/src/lit.rs
+++ b/src/lit.rs
@@ -331,7 +331,14 @@
impl Synom for Lit {
fn parse(input: Cursor) -> PResult<Self> {
match input.literal() {
- Some((span, lit, rest)) => Ok((Lit::new(lit, span), rest)),
+ Some((span, lit, rest)) => {
+ if lit.to_string().starts_with('/') {
+ // Doc comment literal which is not a Syn literal
+ parse_error()
+ } else {
+ Ok((Lit::new(lit, span), rest))
+ }
+ }
_ => match input.term() {
Some((span, term, rest)) => Ok((
Lit::Bool(LitBool {