mirror of
https://github.com/typst/typst
synced 2025-05-20 12:05:27 +08:00
Don't allow nested line comment inside block comment (#3048)
This commit is contained in:
parent
c4d9b0c3d8
commit
c27b9e2b0f
@ -145,10 +145,6 @@ impl Lexer<'_> {
|
|||||||
depth += 1;
|
depth += 1;
|
||||||
'_'
|
'_'
|
||||||
}
|
}
|
||||||
('/', '/') => {
|
|
||||||
self.line_comment();
|
|
||||||
'_'
|
|
||||||
}
|
|
||||||
_ => c,
|
_ => c,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,13 +17,14 @@ C/*
|
|||||||
// End of block comment in line comment.
|
// End of block comment in line comment.
|
||||||
// Hello */
|
// Hello */
|
||||||
|
|
||||||
// Nested line comment.
|
// Nested "//" doesn't count as line comment.
|
||||||
/*//*/
|
/* // */
|
||||||
Still comment.
|
|
||||||
*/
|
|
||||||
|
|
||||||
E
|
E
|
||||||
|
|
||||||
|
/*//*/
|
||||||
|
This is a comment.
|
||||||
|
*/*/
|
||||||
|
|
||||||
---
|
---
|
||||||
// End should not appear without start.
|
// End should not appear without start.
|
||||||
// Error: 7-9 unexpected end of block comment
|
// Error: 7-9 unexpected end of block comment
|
||||||
|
Loading…
x
Reference in New Issue
Block a user