public InterpolatedStringScanner(Lexer lexer) { _lexer = lexer; _kind = (_lexer.TextWindow.PeekChar(0), _lexer.TextWindow.PeekChar(1)) is ('$', '@') or('@', '$') ? InterpolatedStringKind.Verbatim : InterpolatedStringKind.Normal; }
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); }
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); }