/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Compilers/Test/Utilities/VisualBasic/VBParser.vb
28 строк
1 KB
Tomáš Matoušek
Refactoring of extension methods in source packages (#78620) - take 2 (#78894)
26 июн 2025, 18:42
Не верифицирован
26 июн 2025, 18:42
05fc006
Код
Авторство
О чём код?
' Licensed to the .NET Foundation under one or more agreements. ' The .NET Foundation licenses this file to you under the MIT license. ' See the LICENSE file in the project root for more information. Imports System.Reflection Imports System.Text Imports Microsoft.CodeAnalysis.Test.Utilities Imports Microsoft.CodeAnalysis.Text Public Class VBParser Private ReadOnly _options As VisualBasicParseOptions Public Sub New(Optional options As VisualBasicParseOptions = Nothing) _options = options End Sub Public Function Parse(code As String) As SyntaxTree Dim tree = VisualBasicSyntaxTree.ParseText(SourceText.From(code, Encoding.UTF8, SourceHashAlgorithms.Default), _options, path:="") Return tree End Function End Class 'TODO: We need this only temporarily until 893565 is fixed. Public Class VBKindProvider : Implements ISyntaxNodeKindProvider Public Function Kind(node As Object) As String Implements ISyntaxNodeKindProvider.Kind Return node.GetType().GetTypeInfo().GetDeclaredProperty("Kind").GetValue(node, Nothing).ToString() End Function End Class