コード例 #1
0
        private Ust ParseAndConvert(string code, global::AspxParser.Location location)
        {
            SyntaxTree tree      = CSharpSyntaxTree.ParseText(code, new CSharpParseOptions(kind: SourceCodeKind.Script));
            var        converter = new CSharpRoslynParseTreeConverter();
            RootUst    result    = converter.Convert(new CSharpRoslynParseTree(tree)
            {
                SourceCodeFile = sourceCodeFile
            });

            result.ApplyActionToDescendants(ust => ust.TextSpan = ust.TextSpan.AddOffset(location.Start));
            return(result);
        }
コード例 #2
0
 internal static TextSpan GetTextSpan(this global::AspxParser.Location location)
 {
     return(new TextSpan(location.Start, location.Length));
 }