Fix block comment

This commit is contained in:
dalance 2019-09-18 17:29:20 +09:00
parent 3125a2f0d4
commit aa74032837

View File

@ -30,7 +30,10 @@ pub(crate) fn one_line_comment(s: Span) -> IResult<Span, Comment> {
#[packrat_parser]
pub(crate) fn block_comment(s: Span) -> IResult<Span, Comment> {
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 {