Exemple #1
0
            public InterpolatedStringScanner(Lexer lexer)
            {
                _lexer = lexer;

                _kind =
                    (_lexer.TextWindow.PeekChar(0), _lexer.TextWindow.PeekChar(1)) is ('$', '@') or('@', '$')
                        ? InterpolatedStringKind.Verbatim
                        : InterpolatedStringKind.Normal;
            }
Exemple #2
0
 internal void ScanInterpolatedStringLiteralTop(
     out InterpolatedStringKind kind,
     out Range openQuoteRange,
     ArrayBuilder <Interpolation>?interpolations,
     out Range closeQuoteRange)
 {
     kind = _kind;
     ScanInterpolatedStringLiteralStart(out openQuoteRange);
     ScanInterpolatedStringLiteralContents(interpolations);
     ScanInterpolatedStringLiteralEnd(out closeQuoteRange);
 }
Exemple #3
0
        internal void ScanInterpolatedStringLiteralTop(
            ref TokenInfo info,
            out SyntaxDiagnosticInfo?error,
            out InterpolatedStringKind kind,
            out Range openQuoteRange,
            ArrayBuilder <Interpolation>?interpolations,
            out Range closeQuoteRange)
        {
            var subScanner = new InterpolatedStringScanner(this);

            subScanner.ScanInterpolatedStringLiteralTop(out kind, out openQuoteRange, interpolations, out closeQuoteRange);
            error     = subScanner.Error;
            info.Kind = SyntaxKind.InterpolatedStringToken;
            info.Text = TextWindow.GetText(intern: false);
        }