You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a doc comment token, that uses the following regexes:
///[^\n]*
/\*\*([^\*]|\*[^\*/]|\*\*[^/])*\*?\*/
As well as a regular comment token, that skips the following regexes:
//[^\n]*
/\*([^\*]|\*[^/])*\*/
And for some reason, these tests pass:
// first testlet input = "// hello world/* hello world *//// hello world doc/** hello world doc **/";letmut lexer = Token::lexer(input);assert_eq!(lexer.next(), Some(Token::Doc("hello world doc")));assert_eq!(lexer.next(), Some(Token::Doc("hello world doc")));// second testlet input = "// hello world/* hello world *//// hello world doc/** hello world doc */";letmut lexer = Token::lexer(input);assert_eq!(lexer.next(), Some(Token::Doc("hello world doc")));assert_eq!(lexer.next(), Some(Token::Doc("hello world doc")));
While this one doesn't:
let input = "// hello world/* hello world *//// hello world doc/** hello world doc **/";letmut lexer = Token::lexer(input);assert_eq!(lexer.next(), Some(Token::Doc("hello world doc")));assert_eq!(lexer.next(), Some(Token::Doc("hello world doc")));
In this last one, the multiline comment is turned into an Error.
I have a doc comment token, that uses the following regexes:
///[^\n]*
/\*\*([^\*]|\*[^\*/]|\*\*[^/])*\*?\*/
As well as a regular comment token, that skips the following regexes:
//[^\n]*
/\*([^\*]|\*[^/])*\*/
And for some reason, these tests pass:
While this one doesn't:
In this last one, the multiline comment is turned into an
Error
.My lexer
The text was updated successfully, but these errors were encountered: