Exemple #1
0
    // CSharp Spec §2.3.2
    private StateResult BlockComment()
    {
        TakeUntil(c => c == '*');
        if (EndOfFile)
        {
            CurrentErrors.Add(
                RazorDiagnosticFactory.CreateParsing_BlockCommentNotTerminated(
                    new SourceSpan(CurrentStart, contentLength: 1 /* end of file */)));

            return(Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.CSharpComment)));
        }
        if (CurrentCharacter == '*')
        {
            TakeCurrent();
            if (CurrentCharacter == '/')
            {
                TakeCurrent();
                return(Transition(CSharpTokenizerState.Data, EndToken(SyntaxKind.CSharpComment)));
            }
        }
        return(Stay());
    }