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); }
internal static TextSpan GetTextSpan(this global::AspxParser.Location location) { return(new TextSpan(location.Start, location.Length)); }