From aa74032837a22ac005f5405cf5702c623c05af77 Mon Sep 17 00:00:00 2001 From: dalance Date: Wed, 18 Sep 2019 17:29:20 +0900 Subject: [PATCH] Fix block comment --- sv-parser-parser/src/general/comments.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sv-parser-parser/src/general/comments.rs b/sv-parser-parser/src/general/comments.rs index 189252d..c74eda9 100644 --- a/sv-parser-parser/src/general/comments.rs +++ b/sv-parser-parser/src/general/comments.rs @@ -30,7 +30,10 @@ pub(crate) fn one_line_comment(s: Span) -> IResult { #[packrat_parser] pub(crate) fn block_comment(s: Span) -> IResult { let (s, a) = tag("/*")(s)?; - let (s, b) = many0(alt((is_not("*"), terminated(tag("*"), is_not("/")))))(s)?; + let (s, b) = many0(alt(( + is_not("*"), + terminated(tag("*"), peek(not(tag("/")))), + )))(s)?; let (s, c) = tag("*/")(s)?; let mut a = a; for b in b {