There is an interesting case here, which "." should a chain of identifiers move in case of a partial move. The solution uses "prefer left" but it is somewhat arbitrary.

This mapping has 3 multi-map groups: several pairings are equally correct there. The code view shows one arbitrary valid pairing, not the only one.

Code view:

A painting is a person's account of this edit as text, recorded independently of the node mapping - a rendering often has several equally defensible answers where the mapping has one. Deletions and insertions carry no position on the opposite side in a painting, so that panel draws no caret for them.

Before

…lines 1–9 unchanged (9 lines)
10using System.Management.Automation.Runspaces;
11using System.Reflection;
12using System.Runtime.InteropServices;
13using System.Security.AccessControl;
14using System.Security.Principal;
15#if CORECLR
16using Newtonsoft.Json;
17#else
18using System.Web.Script.Serialization;
19#endif
20
21// Newtonsoft.Json may reference a different System.Runtime version (6.x) than loaded by PowerShell 7.3 (7.x).
22// Ignore CS1701 so the code can be compiled when warnings are reported as errors.
23//NoWarn -Name CS1701 -CLR Core
24
25// System.Diagnostics.EventLog.dll reference different versioned dlls that are
26// loaded in PSCore, ignore CS1702 so the code will ignore this warning
27//NoWarn -Name CS1702 -CLR Core
28
29//AssemblyReference -Type Newtonsoft.Json.JsonConvert -CLR Core
30//AssemblyReference -Type System.Diagnostics.EventLog -CLR Core
31//AssemblyReference -Type System.Security.AccessControl.NativeObjectSecurity -CLR Core
32//AssemblyReference -Type System.Security.AccessControl.DirectorySecurity -CLR Core
33//AssemblyReference -Type System.Security.Principal.IdentityReference -CLR Core
34
35//AssemblyReference -Name System.Web.Extensions.dll -CLR Framework
…lines 36–159 unchanged (124 lines)
160 if (!Directory.Exists(baseDir))
161 {
162 string failedMsg = null;
163 try
164 {
165#if CORECLR
166 DirectoryInfo createdDir = Directory.CreateDirectory(baseDir);
167 FileSystemAclExtensions.SetAccessControl(createdDir, dirSecurity);
168#else
169 Directory.CreateDirectory(baseDir, dirSecurity);
170#endif
171 }
172 catch (Exception e)
173 {
…lines 174–190 unchanged (17 lines)
191
192 string dateTime = DateTime.Now.ToFileTime().ToString();
193 string dirName = String.Format("ansible-moduletmp-{0}-{1}-{2}", dateTime, System.Diagnostics.Process.GetCurrentProcess().Id,
194 new Random().Next(0, int.MaxValue));
195 string newTmpdir = Path.Combine(baseDir, dirName);
196#if CORECLR
197 DirectoryInfo tmpdirInfo = Directory.CreateDirectory(newTmpdir);
198 FileSystemAclExtensions.SetAccessControl(tmpdirInfo, dirSecurity);
199#else
200 Directory.CreateDirectory(newTmpdir, dirSecurity);
201#endif
202 tmpdir = newTmpdir;
203
204 if (!KeepRemoteFiles)
…lines 205–426 unchanged (222 lines)
427 }
428
429 public static object FromJson(string json) { return FromJson<object>(json); }
430 public static T FromJson<T>(string json)
431 {
432#if CORECLR
433 return JsonConvert.DeserializeObject<T>(json);
434#else
435 JavaScriptSerializer jss = new JavaScriptSerializer();
436 jss.MaxJsonLength = int.MaxValue;
437 jss.RecursionLimit = int.MaxValue;
438 return jss.Deserialize<T>(json);
439#endif
440 }
441
442 public static string ToJson(object obj)
443 {
444 // Using PowerShell to serialize the JSON is preferable over the native .NET libraries as it handles
445 // PS Objects a lot better than the alternatives. In case we are debugging in Visual Studio we have a
446 // fallback to the other libraries as we won't be dealing with PowerShell objects there.
447 if (Runspace.DefaultRunspace != null)
448 {
449 PSObject rawOut = ScriptBlock.Create("ConvertTo-Json -InputObject $args[0] -Depth 99 -Compress").Invoke(obj)[0];
450 return rawOut.BaseObject as string;
451 }
452 else
453 {
454#if CORECLR
455 return JsonConvert.SerializeObject(obj);
456#else
457 JavaScriptSerializer jss = new JavaScriptSerializer();
458 jss.MaxJsonLength = int.MaxValue;
459 jss.RecursionLimit = int.MaxValue;
460 return jss.Serialize(obj);
461#endif
…lines 462–598 unchanged (137 lines)
599 else if (valueType == typeof(ArrayList))
600 return ((ArrayList)value).Cast<object>().ToList();
601 else if (valueType.IsArray)
602 return ((object[])value).ToList();
603 else if (valueType == typeof(string))
604 return ((string)value).Split(',').Select(s => s.Trim()).ToList<object>();
605 else if (valueType == typeof(int))
606 return new List<object>() { value };
607 else
608 throw new ArgumentException(String.Format("{0} cannot be converted to a list", valueType.FullName));
609 }
610
611 public static string ParsePath(object value)
…lines 612–1070 unchanged (459 lines)
1071 foreach (string parameter in removedParameters)
1072 param.Remove(parameter);
1073
1074 if (unsupportedParameters.Count > 0 && !ignoreUnknownOpts)
1075 {
1076 legalInputs.RemoveAll(x => passVars.Keys.Contains(x.Replace("_ansible_", "")));
1077 string msg = String.Format("Unsupported parameters for ({0}) module: {1}", ModuleName, String.Join(", ", unsupportedParameters));
1078 msg = String.Format("{0}. Supported parameters include: {1}", FormatOptionsContext(msg), String.Join(", ", legalInputs));
1079 FailJson(msg);
1080 }
1081
1082 /*
1083 // Uncomment when we want to start warning users around options that are not a case sensitive match to the spec
1084 if (caseUnsupportedParameters.Count > 0)
…lines 1085–1548 unchanged (464 lines)
1549 private const int FileDispositionInformationEx = 64;
1550
1551 private const int ERROR_INVALID_PARAMETER = 0x00000057;
1552 private const int ERROR_DIR_NOT_EMPTY = 0x00000091;
1553
1554 private static bool? _supportsPosixDelete = null;
1555
1556 [Flags()]
1557 public enum DispositionFlags : uint
1558 {
1559 FILE_DISPOSITION_DO_NOT_DELETE = 0x00000000,
1560 FILE_DISPOSITION_DELETE = 0x00000001,
1561 FILE_DISPOSITION_POSIX_SEMANTICS = 0x00000002,
…lines 1562–1606 unchanged (45 lines)
1607 return handle;
1608 }
1609
1610 [DllImport("Ntdll.dll")]
1611 private static extern int NtSetInformationFile(
1612 SafeFileHandle FileHandle,
1613 out IntPtr IoStatusBlock,
1614 ref int FileInformation,
1615 int Length,
1616 int FileInformationClass);
1617
1618 [DllImport("Ntdll.dll")]
1619 private static extern int RtlNtStatusToDosError(
…lines 1620–1746 unchanged (127 lines)
1747 }
1748 }
1749 }
1750
1751 private static void SetInformationFile(SafeFileHandle handle, int infoClass, int value)
1752 {
1753 IntPtr ioStatusBlock = IntPtr.Zero;
1754
1755 int ntStatus = NtSetInformationFile(handle, out ioStatusBlock, ref value,
1756 Marshal.SizeOf(typeof(int)), infoClass);
1757
1758 if (ntStatus != 0)
1759 {
1760 int errCode = RtlNtStatusToDosError(ntStatus);
1761
…lines 1762–1784 unchanged (23 lines)

After

…lines 1–9 unchanged (9 lines)
10using System.Management.Automation.Runspaces;
11using System.Reflection;
12using System.Runtime.InteropServices;
13using System.Security.AccessControl;
14using System.Security.Principal;
15#if CORECLR
16using System.Text.Json;
17#else
18using System.Web.Script.Serialization;
19#endif
20
21// System.Diagnostics.EventLog.dll reference different versioned dlls that are
22// loaded in PSCore, ignore CS1702 so the code will ignore this warning
23//NoWarn -Name CS1702 -CLR Core
24
25//AssemblyReference -Type System.Diagnostics.EventLog -CLR Core
26//AssemblyReference -Type System.Security.AccessControl.NativeObjectSecurity -CLR Core
27//AssemblyReference -Type System.Security.AccessControl.DirectorySecurity -CLR Core
28//AssemblyReference -Type System.Security.Principal.IdentityReference -CLR Core
29
30//AssemblyReference -Name System.Web.Extensions.dll -CLR Framework
…lines 31–154 unchanged (124 lines)
155 if (!Directory.Exists(baseDir))
156 {
157 string failedMsg = null;
158 try
159 {
160#if CORECLR
161 FileSystemAclExtensions.CreateDirectory(dirSecurity, baseDir);
162#else
163 Directory.CreateDirectory(baseDir, dirSecurity);
164#endif
165 }
166 catch (Exception e)
167 {
…lines 168–184 unchanged (17 lines)
185
186 string dateTime = DateTime.Now.ToFileTime().ToString();
187 string dirName = String.Format("ansible-moduletmp-{0}-{1}-{2}", dateTime, System.Diagnostics.Process.GetCurrentProcess().Id,
188 new Random().Next(0, int.MaxValue));
189 string newTmpdir = Path.Combine(baseDir, dirName);
190#if CORECLR
191 FileSystemAclExtensions.CreateDirectory(dirSecurity, newTmpdir);
192#else
193 Directory.CreateDirectory(newTmpdir, dirSecurity);
194#endif
195 tmpdir = newTmpdir;
196
197 if (!KeepRemoteFiles)
…lines 198–419 unchanged (222 lines)
420 }
421
422 public static object FromJson(string json) { return FromJson<object>(json); }
423 public static T FromJson<T>(string json)
424 {
425#if CORECLR
426 try
427 {
428 if (typeof(T) == typeof(object) || typeof(T) == typeof(Dictionary<string, object>))
429 {
430 using (JsonDocument doc = JsonDocument.Parse(json))
431 {
432 return (T)(object)ConvertJsonElement(doc.RootElement);
433 }
434 }
435 return JsonSerializer.Deserialize<T>(json);
436 }
437 catch (JsonException e)
438 {
439 // For backwards compatibility with JavaScriptSerializer, we
440 // use ArgumentException instead.
441 throw new ArgumentException(String.Format("Failed to parse JSON: {0}", e.Message), e);
442 }
443#else
444 JavaScriptSerializer jss = new JavaScriptSerializer();
445 jss.MaxJsonLength = int.MaxValue;
446 jss.RecursionLimit = int.MaxValue;
447 return jss.Deserialize<T>(json);
448#endif
449 }
450
451#if CORECLR
452 private static object ConvertJsonElement(JsonElement element)
453 {
454 switch (element.ValueKind)
455 {
456 case JsonValueKind.Object:
457 var dict = new Dictionary<string, object>();
458 foreach (JsonProperty prop in element.EnumerateObject())
459 {
460 dict[prop.Name] = ConvertJsonElement(prop.Value);
461 }
462 return dict;
463 case JsonValueKind.Array:
464 // We use ArrayList to copy JavaScriptSerializer behavior
465 var list = new ArrayList();
466 foreach (JsonElement item in element.EnumerateArray())
467 {
468 list.Add(ConvertJsonElement(item));
469 }
470 return list;
471 case JsonValueKind.String:
472 return element.GetString();
473 case JsonValueKind.Number:
474 if (element.TryGetInt32(out int i))
475 return i;
476 else if (element.TryGetInt64(out long l))
477 return l;
478 return element.GetDecimal();
479 case JsonValueKind.True:
480 return true;
481 case JsonValueKind.False:
482 return false;
483 case JsonValueKind.Null:
484 return null;
485 default:
486 throw new ArgumentException($"Unsupported JsonElement type: {element.ValueKind}");
487 }
488 }
489#endif
490
491 public static string ToJson(object obj)
492 {
493 // Using PowerShell to serialize the JSON is preferable over the native .NET libraries as it handles
494 // PS Objects a lot better than the alternatives. In case we are debugging in Visual Studio we have a
495 // fallback to the other libraries as we won't be dealing with PowerShell objects there.
496 if (Runspace.DefaultRunspace != null)
497 {
498 PSObject rawOut = ScriptBlock.Create("ConvertTo-Json -InputObject $args[0] -Depth 99 -Compress").Invoke(obj)[0];
499 return rawOut.BaseObject as string;
500 }
501 else
502 {
503#if CORECLR
504 return JsonSerializer.Serialize(obj);
505#else
506 JavaScriptSerializer jss = new JavaScriptSerializer();
507 jss.MaxJsonLength = int.MaxValue;
508 jss.RecursionLimit = int.MaxValue;
509 return jss.Serialize(obj);
510#endif
…lines 511–647 unchanged (137 lines)
648 else if (valueType == typeof(ArrayList))
649 return ((ArrayList)value).Cast<object>().ToList();
650 else if (valueType.IsArray)
651 return ((object[])value).ToList();
652 else if (valueType == typeof(string))
653 return ((string)value).Split(',').Select(s => s.Trim()).ToList<object>();
654 else if (valueType == typeof(int) || valueType == typeof(long))
655 return new List<object>() { value };
656 else
657 throw new ArgumentException(String.Format("{0} cannot be converted to a list", valueType.FullName));
658 }
659
660 public static string ParsePath(object value)
…lines 661–1119 unchanged (459 lines)
1120 foreach (string parameter in removedParameters)
1121 param.Remove(parameter);
1122
1123 if (unsupportedParameters.Count > 0 && !ignoreUnknownOpts)
1124 {
1125 legalInputs.RemoveAll(x => passVars.Keys.Contains(x.Replace("_ansible_", "")));
1126 IEnumerable<string> unsupportedSorted = unsupportedParameters.OrderBy(s => s, StringComparer.Ordinal);
1127 IEnumerable<string> legalInputsSorted = legalInputs.OrderBy(s => s, StringComparer.Ordinal);
1128 string msg = String.Format("Unsupported parameters for ({0}) module: {1}", ModuleName, String.Join(", ", unsupportedSorted));
1129 msg = String.Format("{0}. Supported parameters include: {1}", FormatOptionsContext(msg), String.Join(", ", legalInputsSorted));
1130 FailJson(msg);
1131 }
1132
1133 /*
1134 // Uncomment when we want to start warning users around options that are not a case sensitive match to the spec
1135 if (caseUnsupportedParameters.Count > 0)
…lines 1136–1600 unchanged (465 lines)
1601
1602 private const int ERROR_INVALID_PARAMETER = 0x00000057;
1603 private const int ERROR_DIR_NOT_EMPTY = 0x00000091;
1604
1605 private static bool? _supportsPosixDelete = null;
1606
1607 [StructLayout(LayoutKind.Sequential)]
1608 public struct IO_STATUS_BLOCK
1609 {
1610 public int Status;
1611 public IntPtr Information;
1612 }
1613
1614 [Flags()]
1615 public enum DispositionFlags : uint
1616 {
1617 FILE_DISPOSITION_DO_NOT_DELETE = 0x00000000,
1618 FILE_DISPOSITION_DELETE = 0x00000001,
…lines 1619–1664 unchanged (46 lines)
1665 return handle;
1666 }
1667
1668 [DllImport("Ntdll.dll")]
1669 private static extern int NtSetInformationFile(
1670 SafeFileHandle FileHandle,
1671 ref IO_STATUS_BLOCK IoStatusBlock,
1672 ref int FileInformation,
1673 int Length,
1674 int FileInformationClass);
1675
1676 [DllImport("Ntdll.dll")]
1677 private static extern int RtlNtStatusToDosError(
…lines 1678–1804 unchanged (127 lines)
1805 }
1806 }
1807 }
1808
1809 private static void SetInformationFile(SafeFileHandle handle, int infoClass, int value)
1810 {
1811 IO_STATUS_BLOCK ioStatusBlock = new IO_STATUS_BLOCK();
1812
1813 int ntStatus = NtSetInformationFile(handle, ref ioStatusBlock, ref value,
1814 Marshal.SizeOf(typeof(int)), infoClass);
1815
1816 if (ntStatus != 0)
1817 {
1818 int errCode = RtlNtStatusToDosError(ntStatus);
1819
…lines 1820–1842 unchanged (23 lines)

Before

compilation_unit
using_directive
using "using"
qualified_name
qualified_name
identifier "Microsoft"
. "."
identifier "Win32"
. "."
identifier "SafeHandles"
; ";"
using_directive
using "using"
identifier "System"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "Collections"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Collections"
. "."
identifier "Generic"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "ComponentModel"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "Diagnostics"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "IO"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "Linq"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Management"
. "."
identifier "Automation"
; ";"
using_directive
using "using"
qualified_name
qualified_name
qualified_name
identifier "System"
. "."
identifier "Management"
. "."
identifier "Automation"
. "."
identifier "Runspaces"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "Reflection"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Runtime"
. "."
identifier "InteropServices"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Security"
. "."
identifier "AccessControl"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Security"
. "."
identifier "Principal"
; ";"
preproc_if
#if "#if"
identifier "CORECLR"
using_directive
using "using"
qualified_name any 1:2
identifier "Newtonsoft" any 1:3
. "."
identifier "Json"
; ";"
preproc_else
#else "#else"
using_directive
using "using"
qualified_name
qualified_name
qualified_name
identifier "System"
. "."
identifier "Web"
. "."
identifier "Script"
. "."
identifier "Serialization"
; ";"
#endif "#endif"
comment "// Newtonsoft.Json may reference a different System.Runtime "...
comment "// Ignore CS1701 so the code can be compiled when warnings a"...
comment "//NoWarn -Name CS1701 -CLR Core"
comment "// System.Diagnostics.EventLog.dll reference different versi"...
comment "// loaded in PSCore, ignore CS1702 so the code will ignore t"...
comment "//NoWarn -Name CS1702 -CLR Core"
comment "//AssemblyReference -Type Newtonsoft.Json.JsonConvert -CLR C"...
comment "//AssemblyReference -Type System.Diagnostics.EventLog -CLR C"...
comment "//AssemblyReference -Type System.Security.AccessControl.Nati"...
comment "//AssemblyReference -Type System.Security.AccessControl.Dire"...
comment "//AssemblyReference -Type System.Security.Principal.Identity"...
comment "//AssemblyReference -Name System.Web.Extensions.dll -CLR Fra"...
namespace_declaration
namespace "namespace"
qualified_name
identifier "Ansible"
. "."
identifier "Basic"
declaration_list
{ "{"
class_declaration
modifier
public "public"
class "class"
identifier "AnsibleModule"
declaration_list
{ "{"
delegate_declaration
modifier
public "public"
delegate "delegate"
predefined_type "void"
identifier "ExitHandler"
parameter_list
( "("
parameter
predefined_type "int"
identifier "rc"
) ")"
; ";"
field_declaration
modifier
public "public"
modifier
static "static"
variable_declaration
identifier "ExitHandler"
variable_declarator
identifier "Exit"
= "="
object_creation_expression
new "new"
identifier "ExitHandler"
argument_list
( "("
argument
identifier "ExitModule"
) ")"
; ";"
delegate_declaration
modifier
public "public"
delegate "delegate"
predefined_type "void"
identifier "WriteLineHandler"
parameter_list
( "("
parameter
predefined_type "string"
identifier "line"
) ")"
; ";"
field_declaration
modifier
public "public"
modifier
static "static"
variable_declaration
identifier "WriteLineHandler"
variable_declarator
identifier "WriteLine"
= "="
object_creation_expression
new "new"
identifier "WriteLineHandler"
argument_list
( "("
argument
identifier "WriteLineModule"
) ")"
; ";"
field_declaration
modifier
public "public"
modifier
static "static"
variable_declaration
predefined_type "bool"
variable_declarator
identifier "_DebugArgSpec"
= "="
boolean_literal
false "false"
; ";"
comment "// Used by the executor scripts to store warnings from the w"...
comment "// This is public to avoid reflection but should not be used"...
field_declaration
modifier
public "public"
modifier
static "static"
variable_declaration
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "string"
> ">"
variable_declarator
identifier "_WrapperWarnings"
; ";"
field_declaration (+64 nodes collapsed)
field_declaration (+64 nodes collapsed)
field_declaration
modifier
private "private"
variable_declaration
predefined_type "bool"
variable_declarator
identifier "ignoreUnknownOpts"
= "="
boolean_literal
false "false"
; ";"
field_declaration
modifier
private "private"
variable_declaration
predefined_type "string"
variable_declarator
identifier "remoteTmp"
= "="
invocation_expression
member_access_expression
identifier "Path"
. "."
identifier "GetTempPath"
argument_list
( "("
) ")"
; ";"
field_declaration
modifier
private "private"
variable_declaration
predefined_type "string"
variable_declarator
identifier "tmpdir"
= "="
null_literal "null"
; ";"
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+39 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+21 nodes collapsed)
field_declaration (+243 nodes collapsed)
field_declaration (+57 nodes collapsed)
field_declaration (+32 nodes collapsed)
field_declaration (+27 nodes collapsed)
field_declaration (+734 nodes collapsed)
field_declaration (+284 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration
modifier
public "public"
variable_declaration
identifier "IDictionary"
variable_declarator
identifier "Params"
= "="
null_literal "null"
; ";"
field_declaration (+42 nodes collapsed)
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "CheckMode"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "DebugMode"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "DiffMode"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "KeepRemoteFiles"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "string"
identifier "ModuleName"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "NoLog"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "string"
identifier "TargetLogInfo"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "int"
identifier "Verbosity"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "string"
identifier "AnsibleVersion"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration (+21 nodes collapsed)
property_declaration
modifier
public "public"
predefined_type "string"
identifier "Tmpdir"
accessor_list
{ "{"
accessor_declaration
get "get"
block
{ "{"
if_statement
if "if"
( "("
binary_expression
identifier "tmpdir"
== "=="
null_literal "null"
) ")"
block
{ "{"
preproc_if
#if "#if"
identifier "WINDOWS"
local_declaration_statement
variable_declaration
identifier "SecurityIdentifier"
variable_declarator
identifier "user"
= "="
member_access_expression
invocation_expression
member_access_expression
identifier "WindowsIdentity"
. "."
identifier "GetCurrent"
argument_list
( "("
) ")"
. "."
identifier "User"
; ";"
local_declaration_statement
variable_declaration
identifier "DirectorySecurity"
variable_declarator
identifier "dirSecurity"
= "="
object_creation_expression
new "new"
identifier "DirectorySecurity"
argument_list
( "("
) ")"
; ";"
expression_statement
invocation_expression
member_access_expression
identifier "dirSecurity"
. "."
identifier "SetOwner"
argument_list
( "("
argument
identifier "user"
) ")"
; ";"
expression_statement
invocation_expression
member_access_expression
identifier "dirSecurity"
. "."
identifier "SetAccessRuleProtection"
argument_list
( "("
argument
boolean_literal
true "true"
, ","
argument
boolean_literal
false "false"
) ")"
; ";"
comment "// disable inheritance rules"
local_declaration_statement (+45 nodes collapsed)
expression_statement
invocation_expression
member_access_expression
identifier "dirSecurity"
. "."
identifier "AddAccessRule"
argument_list
( "("
argument
identifier "ace"
) ")"
; ";"
local_declaration_statement (+26 nodes collapsed)
if_statement
if "if"
( "("
prefix_unary_expression
! "!"
invocation_expression
member_access_expression
identifier "Directory"
. "."
identifier "Exists"
argument_list
( "("
argument
identifier "baseDir"
) ")"
) ")"
block
{ "{"
local_declaration_statement
variable_declaration
predefined_type "string"
variable_declarator
identifier "failedMsg"
= "="
null_literal "null"
; ";"
try_statement
try "try"
block
{ "{"
preproc_if
#if "#if"
identifier "CORECLR"
local_declaration_statement
variable_declaration
identifier "DirectoryInfo"
variable_declarator
identifier "createdDir"
= "="
invocation_expression
member_access_expression
identifier "Directory"
. "."
identifier "CreateDirectory"
argument_list
( "("
argument
identifier "baseDir"
) ")"
; ";"
expression_statement
invocation_expression
member_access_expression
identifier "FileSystemAclExtensions"
. "."
identifier "SetAccessControl"
argument_list
( "("
argument
identifier "createdDir"
, ","
argument
identifier "dirSecurity"
) ")"
; ";"
preproc_else
#else "#else"
expression_statement
invocation_expression
member_access_expression
identifier "Directory"
. "."
identifier "CreateDirectory"
argument_list
( "("
argument
identifier "baseDir"
, ","
argument
identifier "dirSecurity"
) ")"
; ";"
#endif "#endif"
} "}"
catch_clause (+37 nodes collapsed)
if_statement (+142 nodes collapsed)
} "}"
local_declaration_statement (+25 nodes collapsed)
local_declaration_statement (+65 nodes collapsed)
local_declaration_statement
variable_declaration
predefined_type "string"
variable_declarator
identifier "newTmpdir"
= "="
invocation_expression
member_access_expression
identifier "Path"
. "."
identifier "Combine"
argument_list
( "("
argument
identifier "baseDir"
, ","
argument
identifier "dirName"
) ")"
; ";"
preproc_if
#if "#if"
identifier "CORECLR"
local_declaration_statement
variable_declaration
identifier "DirectoryInfo"
variable_declarator
identifier "tmpdirInfo"
= "="
invocation_expression
member_access_expression
identifier "Directory"
. "."
identifier "CreateDirectory"
argument_list
( "("
argument
identifier "newTmpdir"
) ")"
; ";"
expression_statement
invocation_expression
member_access_expression
identifier "FileSystemAclExtensions"
. "."
identifier "SetAccessControl"
argument_list
( "("
argument
identifier "tmpdirInfo"
, ","
argument
identifier "dirSecurity"
) ")"
; ";"
preproc_else
#else "#else"
expression_statement
invocation_expression
member_access_expression
identifier "Directory"
. "."
identifier "CreateDirectory"
argument_list
( "("
argument
identifier "newTmpdir"
, ","
argument
identifier "dirSecurity"
) ")"
; ";"
#endif "#endif"
expression_statement
assignment_expression
identifier "tmpdir"
= "="
identifier "newTmpdir"
; ";"
if_statement
if "if"
( "("
prefix_unary_expression
! "!"
identifier "KeepRemoteFiles"
) ")"
expression_statement
invocation_expression
member_access_expression
identifier "cleanupFiles"
. "."
identifier "Add"
argument_list
( "("
argument
identifier "tmpdir"
) ")"
; ";"
preproc_else
#else "#else"
throw_statement
throw "throw"
object_creation_expression
new "new"
identifier "NotImplementedException"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content "Tmpdir is only supported on Windows"
" "\""
) ")"
; ";"
#endif "#endif"
} "}"
return_statement
return "return"
identifier "tmpdir"
; ";"
} "}"
} "}"
constructor_declaration (+692 nodes collapsed)
method_declaration (+51 nodes collapsed)
method_declaration (+43 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+105 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+125 nodes collapsed)
method_declaration (+47 nodes collapsed)
method_declaration (+29 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+328 nodes collapsed)
method_declaration (+400 nodes collapsed)
method_declaration (+56 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration
modifier
public "public"
modifier
static "static"
identifier "T"
identifier "FromJson"
type_parameter_list
< "<"
type_parameter
identifier "T"
> ">"
parameter_list
( "("
parameter
predefined_type "string"
identifier "json"
) ")"
block
{ "{"
preproc_if
#if "#if"
identifier "CORECLR"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "JsonConvert"
. "."
generic_name
identifier "DeserializeObject"
type_argument_list
< "<"
identifier "T"
> ">"
argument_list
( "("
argument
identifier "json"
) ")"
; ";"
preproc_else (+57 nodes collapsed)
#endif "#endif"
} "}"
method_declaration
modifier
public "public"
modifier
static "static"
predefined_type "string"
identifier "ToJson"
parameter_list
( "("
parameter
predefined_type "object"
identifier "obj"
) ")"
block
{ "{"
comment "// Using PowerShell to serialize the JSON is preferable over"...
comment "// PS Objects a lot better than the alternatives. In case we"...
comment "// fallback to the other libraries as we won't be dealing wi"...
if_statement
if "if"
( "("
binary_expression
member_access_expression
identifier "Runspace"
. "."
identifier "DefaultRunspace"
!= "!="
null_literal "null"
) ")"
block (+48 nodes collapsed)
else "else"
block
{ "{"
preproc_if
#if "#if"
identifier "CORECLR"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "JsonConvert"
. "."
identifier "SerializeObject"
argument_list
( "("
argument
identifier "obj"
) ")"
; ";"
preproc_else (+52 nodes collapsed)
#endif "#endif"
} "}"
} "}"
method_declaration (+188 nodes collapsed)
method_declaration (+209 nodes collapsed)
method_declaration (+728 nodes collapsed)
method_declaration (+70 nodes collapsed)
method_declaration (+71 nodes collapsed)
method_declaration (+103 nodes collapsed)
method_declaration
modifier
public "public"
modifier
static "static"
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "object"
> ">"
identifier "ParseList"
parameter_list
( "("
parameter
predefined_type "object"
identifier "value"
) ")"
block
{ "{"
if_statement
if "if"
( "("
binary_expression
identifier "value"
== "=="
null_literal "null"
) ")"
return_statement
return "return"
null_literal "null"
; ";"
local_declaration_statement
variable_declaration
identifier "Type"
variable_declarator
identifier "valueType"
= "="
invocation_expression
member_access_expression
identifier "value"
. "."
identifier "GetType"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
( "("
binary_expression (+25 nodes collapsed)
) ")"
return_statement
return "return"
cast_expression
( "("
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "object"
> ">"
) ")"
identifier "value"
; ";"
else "else"
if_statement
if "if"
( "("
binary_expression
identifier "valueType"
== "=="
typeof_expression
typeof "typeof"
( "("
identifier "ArrayList"
) ")"
) ")"
return_statement (+30 nodes collapsed)
else "else"
if_statement
if "if"
( "("
member_access_expression
identifier "valueType"
. "."
identifier "IsArray"
) ")"
return_statement (+22 nodes collapsed)
else "else"
if_statement
if "if"
( "("
binary_expression
identifier "valueType"
== "=="
typeof_expression
typeof "typeof"
( "("
predefined_type "string"
) ")"
) ")"
return_statement (+54 nodes collapsed)
else "else"
if_statement
if "if"
( "("
binary_expression any 1:2
identifier "valueType"
== "=="
typeof_expression
typeof "typeof"
( "("
predefined_type "int"
) ")"
) ")"
return_statement
return "return"
object_creation_expression
new "new"
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "object"
> ">"
argument_list
( "("
) ")"
initializer_expression
{ "{"
identifier "value"
} "}"
; ";"
else "else"
throw_statement (+29 nodes collapsed)
} "}"
method_declaration (+122 nodes collapsed)
method_declaration
modifier
public "public"
modifier
static "static"
predefined_type "object"
identifier "ParseRaw"
parameter_list
( "("
parameter
predefined_type "object"
identifier "value"
) ")"
block
{ "{"
return_statement
return "return"
identifier "value"
; ";"
} "}"
method_declaration (+92 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+1076 nodes collapsed)
method_declaration (+187 nodes collapsed)
method_declaration (+284 nodes collapsed)
method_declaration (+876 nodes collapsed)
method_declaration (+366 nodes collapsed)
method_declaration (+1041 nodes collapsed)
method_declaration
modifier
private "private"
predefined_type "void"
identifier "CheckUnsupportedArguments"
parameter_list
( "("
parameter
identifier "IDictionary"
identifier "param"
, ","
parameter
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "string"
> ">"
identifier "legalInputs"
) ")"
block
{ "{"
local_declaration_statement (+23 nodes collapsed)
local_declaration_statement (+23 nodes collapsed)
local_declaration_statement (+23 nodes collapsed)
foreach_statement (+441 nodes collapsed)
foreach_statement
foreach "foreach"
( "("
predefined_type "string"
identifier "parameter"
in "in"
identifier "removedParameters"
) ")"
expression_statement
invocation_expression
member_access_expression
identifier "param"
. "."
identifier "Remove"
argument_list
( "("
argument
identifier "parameter"
) ")"
; ";"
if_statement
if "if"
( "("
binary_expression
binary_expression
member_access_expression
identifier "unsupportedParameters"
. "."
identifier "Count"
> ">"
integer_literal "0"
&& "&&"
prefix_unary_expression
! "!"
identifier "ignoreUnknownOpts"
) ")"
block
{ "{"
expression_statement (+44 nodes collapsed)
local_declaration_statement
variable_declaration
predefined_type "string"
variable_declarator
identifier "msg"
= "="
invocation_expression
member_access_expression
identifier "String"
. "."
identifier "Format"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content "Unsupported parameters for ({0}) module: {1}"
" "\""
, ","
argument
identifier "ModuleName"
, ","
argument
invocation_expression
member_access_expression
identifier "String"
. "."
identifier "Join"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content ", "
" "\""
, ","
argument
identifier "unsupportedParameters"
) ")"
) ")"
; ";"
expression_statement
assignment_expression
identifier "msg"
= "="
invocation_expression
member_access_expression
identifier "String"
. "."
identifier "Format"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content "{0}. Supported parameters include: {1}"
" "\""
, ","
argument
invocation_expression
identifier "FormatOptionsContext"
argument_list
( "("
argument
identifier "msg"
) ")"
, ","
argument
invocation_expression
member_access_expression
identifier "String"
. "."
identifier "Join"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content ", "
" "\""
, ","
argument
identifier "legalInputs"
) ")"
) ")"
; ";"
expression_statement
invocation_expression
identifier "FailJson"
argument_list
( "("
argument
identifier "msg"
) ")"
; ";"
} "}"
comment "/*\n // Uncomment when we want to start warning us"...
comment "// Make sure we convert all the incorrect case params to the"...
foreach_statement (+93 nodes collapsed)
} "}"
method_declaration (+178 nodes collapsed)
method_declaration (+254 nodes collapsed)
method_declaration (+235 nodes collapsed)
method_declaration (+178 nodes collapsed)
method_declaration (+449 nodes collapsed)
method_declaration (+233 nodes collapsed)
method_declaration (+526 nodes collapsed)
method_declaration (+317 nodes collapsed)
method_declaration (+213 nodes collapsed)
method_declaration (+316 nodes collapsed)
method_declaration (+279 nodes collapsed)
method_declaration (+517 nodes collapsed)
method_declaration (+178 nodes collapsed)
method_declaration (+77 nodes collapsed)
method_declaration (+26 nodes collapsed)
method_declaration (+113 nodes collapsed)
method_declaration (+28 nodes collapsed)
} "}"
preproc_if
#if "#if"
identifier "WINDOWS"
comment "// Windows is tricky as AVs and other software might still"
comment "// have an open handle to files causing a failure. Use a"
comment "// custom deletion mechanism to remove the files/dirs."
comment "// https://github.com/ansible/ansible/pull/80247"
class_declaration
modifier
internal "internal"
modifier
static "static"
class "class"
identifier "FileCleaner"
declaration_list
{ "{"
field_declaration
modifier
private "private"
modifier
const "const"
variable_declaration
predefined_type "int"
variable_declarator
identifier "FileDispositionInformation"
= "="
integer_literal "13"
; ";"
field_declaration
modifier
private "private"
modifier
const "const"
variable_declaration
predefined_type "int"
variable_declarator
identifier "FileDispositionInformationEx"
= "="
integer_literal "64"
; ";"
field_declaration
modifier
private "private"
modifier
const "const"
variable_declaration
predefined_type "int"
variable_declarator
identifier "ERROR_INVALID_PARAMETER"
= "="
integer_literal "0x00000057"
; ";"
field_declaration
modifier
private "private"
modifier
const "const"
variable_declaration
predefined_type "int"
variable_declarator
identifier "ERROR_DIR_NOT_EMPTY"
= "="
integer_literal "0x00000091"
; ";"
field_declaration
modifier
private "private"
modifier
static "static"
variable_declaration
nullable_type
predefined_type "bool"
? "?"
variable_declarator
identifier "_supportsPosixDelete"
= "="
null_literal "null"
; ";"
enum_declaration (+49 nodes collapsed)
enum_declaration (+74 nodes collapsed)
method_declaration (+80 nodes collapsed)
method_declaration (+176 nodes collapsed)
method_declaration
attribute_list
[ "["
attribute
identifier "DllImport"
attribute_argument_list
( "("
attribute_argument
string_literal
" "\""
string_literal_content "Ntdll.dll"
" "\""
) ")"
] "]"
modifier
private "private"
modifier
static "static"
modifier
extern "extern"
predefined_type "int"
identifier "NtSetInformationFile"
parameter_list
( "("
parameter
identifier "SafeFileHandle"
identifier "FileHandle"
, ","
parameter
modifier "out"
identifier "IntPtr"
identifier "IoStatusBlock"
, ","
parameter
modifier "ref"
predefined_type "int"
identifier "FileInformation"
, ","
parameter
predefined_type "int"
identifier "Length"
, ","
parameter
predefined_type "int"
identifier "FileInformationClass"
) ")"
; ";"
method_declaration (+29 nodes collapsed)
method_declaration (+442 nodes collapsed)
method_declaration (+257 nodes collapsed)
method_declaration
modifier
private "private"
modifier
static "static"
predefined_type "void"
identifier "SetInformationFile"
parameter_list
( "("
parameter
identifier "SafeFileHandle"
identifier "handle"
, ","
parameter
predefined_type "int"
identifier "infoClass"
, ","
parameter
predefined_type "int"
identifier "value"
) ")"
block
{ "{"
local_declaration_statement
variable_declaration
identifier "IntPtr"
variable_declarator
identifier "ioStatusBlock"
= "="
member_access_expression
identifier "IntPtr"
. "."
identifier "Zero"
; ";"
local_declaration_statement
variable_declaration
predefined_type "int"
variable_declarator
identifier "ntStatus"
= "="
invocation_expression
identifier "NtSetInformationFile"
argument_list
( "("
argument
identifier "handle"
, ","
argument
out "out"
identifier "ioStatusBlock"
, ","
argument
ref "ref"
identifier "value"
, ","
argument
invocation_expression
member_access_expression
identifier "Marshal"
. "."
identifier "SizeOf"
argument_list
( "("
argument
typeof_expression
typeof "typeof"
( "("
predefined_type "int"
) ")"
) ")"
, ","
argument
identifier "infoClass"
) ")"
; ";"
if_statement (+110 nodes collapsed)
if_statement
if "if"
( "("
binary_expression
identifier "infoClass"
== "=="
identifier "FileDispositionInformationEx"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "_supportsPosixDelete"
= "="
boolean_literal
true "true"
; ";"
} "}"
} "}"
} "}"
#endif "#endif"
} "}"

After

compilation_unit
using_directive
using "using"
qualified_name
qualified_name
identifier "Microsoft"
. "."
identifier "Win32"
. "."
identifier "SafeHandles"
; ";"
using_directive
using "using"
identifier "System"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "Collections"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Collections"
. "."
identifier "Generic"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "ComponentModel"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "Diagnostics"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "IO"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "Linq"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Management"
. "."
identifier "Automation"
; ";"
using_directive
using "using"
qualified_name
qualified_name
qualified_name
identifier "System"
. "."
identifier "Management"
. "."
identifier "Automation"
. "."
identifier "Runspaces"
; ";"
using_directive
using "using"
qualified_name
identifier "System"
. "."
identifier "Reflection"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Runtime"
. "."
identifier "InteropServices"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Security"
. "."
identifier "AccessControl"
; ";"
using_directive
using "using"
qualified_name
qualified_name
identifier "System"
. "."
identifier "Security"
. "."
identifier "Principal"
; ";"
preproc_if
#if "#if"
identifier "CORECLR"
using_directive
using "using"
qualified_name any 1:2
qualified_name any 1:2
identifier "System" any 1:3
. "." any 1:3
identifier "Text" any 1:3
. "."
identifier "Json"
; ";"
preproc_else
#else "#else"
using_directive
using "using"
qualified_name
qualified_name
qualified_name
identifier "System"
. "."
identifier "Web"
. "."
identifier "Script"
. "."
identifier "Serialization"
; ";"
#endif "#endif"
comment "// System.Diagnostics.EventLog.dll reference different versi"...
comment "// loaded in PSCore, ignore CS1702 so the code will ignore t"...
comment "//NoWarn -Name CS1702 -CLR Core"
comment "//AssemblyReference -Type System.Diagnostics.EventLog -CLR C"...
comment "//AssemblyReference -Type System.Security.AccessControl.Nati"...
comment "//AssemblyReference -Type System.Security.AccessControl.Dire"...
comment "//AssemblyReference -Type System.Security.Principal.Identity"...
comment "//AssemblyReference -Name System.Web.Extensions.dll -CLR Fra"...
namespace_declaration
namespace "namespace"
qualified_name
identifier "Ansible"
. "."
identifier "Basic"
declaration_list
{ "{"
class_declaration
modifier
public "public"
class "class"
identifier "AnsibleModule"
declaration_list
{ "{"
delegate_declaration
modifier
public "public"
delegate "delegate"
predefined_type "void"
identifier "ExitHandler"
parameter_list
( "("
parameter
predefined_type "int"
identifier "rc"
) ")"
; ";"
field_declaration
modifier
public "public"
modifier
static "static"
variable_declaration
identifier "ExitHandler"
variable_declarator
identifier "Exit"
= "="
object_creation_expression
new "new"
identifier "ExitHandler"
argument_list
( "("
argument
identifier "ExitModule"
) ")"
; ";"
delegate_declaration
modifier
public "public"
delegate "delegate"
predefined_type "void"
identifier "WriteLineHandler"
parameter_list
( "("
parameter
predefined_type "string"
identifier "line"
) ")"
; ";"
field_declaration
modifier
public "public"
modifier
static "static"
variable_declaration
identifier "WriteLineHandler"
variable_declarator
identifier "WriteLine"
= "="
object_creation_expression
new "new"
identifier "WriteLineHandler"
argument_list
( "("
argument
identifier "WriteLineModule"
) ")"
; ";"
field_declaration
modifier
public "public"
modifier
static "static"
variable_declaration
predefined_type "bool"
variable_declarator
identifier "_DebugArgSpec"
= "="
boolean_literal
false "false"
; ";"
comment "// Used by the executor scripts to store warnings from the w"...
comment "// This is public to avoid reflection but should not be used"...
field_declaration
modifier
public "public"
modifier
static "static"
variable_declaration
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "string"
> ">"
variable_declarator
identifier "_WrapperWarnings"
; ";"
field_declaration (+64 nodes collapsed)
field_declaration (+64 nodes collapsed)
field_declaration
modifier
private "private"
variable_declaration
predefined_type "bool"
variable_declarator
identifier "ignoreUnknownOpts"
= "="
boolean_literal
false "false"
; ";"
field_declaration
modifier
private "private"
variable_declaration
predefined_type "string"
variable_declarator
identifier "remoteTmp"
= "="
invocation_expression
member_access_expression
identifier "Path"
. "."
identifier "GetTempPath"
argument_list
( "("
) ")"
; ";"
field_declaration
modifier
private "private"
variable_declaration
predefined_type "string"
variable_declarator
identifier "tmpdir"
= "="
null_literal "null"
; ";"
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+39 nodes collapsed)
field_declaration (+25 nodes collapsed)
field_declaration (+21 nodes collapsed)
field_declaration (+243 nodes collapsed)
field_declaration (+57 nodes collapsed)
field_declaration (+32 nodes collapsed)
field_declaration (+27 nodes collapsed)
field_declaration (+734 nodes collapsed)
field_declaration (+284 nodes collapsed)
field_declaration (+29 nodes collapsed)
field_declaration
modifier
public "public"
variable_declaration
identifier "IDictionary"
variable_declarator
identifier "Params"
= "="
null_literal "null"
; ";"
field_declaration (+42 nodes collapsed)
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "CheckMode"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "DebugMode"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "DiffMode"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "KeepRemoteFiles"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "string"
identifier "ModuleName"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "bool"
identifier "NoLog"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "string"
identifier "TargetLogInfo"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "int"
identifier "Verbosity"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration
modifier
public "public"
predefined_type "string"
identifier "AnsibleVersion"
accessor_list
{ "{"
accessor_declaration
get "get"
; ";"
accessor_declaration
modifier
private "private"
set "set"
; ";"
} "}"
property_declaration (+21 nodes collapsed)
property_declaration
modifier
public "public"
predefined_type "string"
identifier "Tmpdir"
accessor_list
{ "{"
accessor_declaration
get "get"
block
{ "{"
if_statement
if "if"
( "("
binary_expression
identifier "tmpdir"
== "=="
null_literal "null"
) ")"
block
{ "{"
preproc_if
#if "#if"
identifier "WINDOWS"
local_declaration_statement
variable_declaration
identifier "SecurityIdentifier"
variable_declarator
identifier "user"
= "="
member_access_expression
invocation_expression
member_access_expression
identifier "WindowsIdentity"
. "."
identifier "GetCurrent"
argument_list
( "("
) ")"
. "."
identifier "User"
; ";"
local_declaration_statement
variable_declaration
identifier "DirectorySecurity"
variable_declarator
identifier "dirSecurity"
= "="
object_creation_expression
new "new"
identifier "DirectorySecurity"
argument_list
( "("
) ")"
; ";"
expression_statement
invocation_expression
member_access_expression
identifier "dirSecurity"
. "."
identifier "SetOwner"
argument_list
( "("
argument
identifier "user"
) ")"
; ";"
expression_statement
invocation_expression
member_access_expression
identifier "dirSecurity"
. "."
identifier "SetAccessRuleProtection"
argument_list
( "("
argument
boolean_literal
true "true"
, ","
argument
boolean_literal
false "false"
) ")"
; ";"
comment "// disable inheritance rules"
local_declaration_statement (+45 nodes collapsed)
expression_statement
invocation_expression
member_access_expression
identifier "dirSecurity"
. "."
identifier "AddAccessRule"
argument_list
( "("
argument
identifier "ace"
) ")"
; ";"
local_declaration_statement (+26 nodes collapsed)
if_statement
if "if"
( "("
prefix_unary_expression
! "!"
invocation_expression
member_access_expression
identifier "Directory"
. "."
identifier "Exists"
argument_list
( "("
argument
identifier "baseDir"
) ")"
) ")"
block
{ "{"
local_declaration_statement
variable_declaration
predefined_type "string"
variable_declarator
identifier "failedMsg"
= "="
null_literal "null"
; ";"
try_statement
try "try"
block
{ "{"
preproc_if
#if "#if"
identifier "CORECLR"
expression_statement
invocation_expression
member_access_expression
identifier "FileSystemAclExtensions"
. "."
identifier "CreateDirectory"
argument_list
( "("
argument
identifier "dirSecurity"
, ","
argument
identifier "baseDir"
) ")"
; ";"
preproc_else
#else "#else"
expression_statement
invocation_expression
member_access_expression
identifier "Directory"
. "."
identifier "CreateDirectory"
argument_list
( "("
argument
identifier "baseDir"
, ","
argument
identifier "dirSecurity"
) ")"
; ";"
#endif "#endif"
} "}"
catch_clause (+37 nodes collapsed)
if_statement (+142 nodes collapsed)
} "}"
local_declaration_statement (+25 nodes collapsed)
local_declaration_statement (+65 nodes collapsed)
local_declaration_statement
variable_declaration
predefined_type "string"
variable_declarator
identifier "newTmpdir"
= "="
invocation_expression
member_access_expression
identifier "Path"
. "."
identifier "Combine"
argument_list
( "("
argument
identifier "baseDir"
, ","
argument
identifier "dirName"
) ")"
; ";"
preproc_if
#if "#if"
identifier "CORECLR"
expression_statement
invocation_expression
member_access_expression
identifier "FileSystemAclExtensions"
. "."
identifier "CreateDirectory"
argument_list
( "("
argument
identifier "dirSecurity"
, ","
argument
identifier "newTmpdir"
) ")"
; ";"
preproc_else
#else "#else"
expression_statement
invocation_expression
member_access_expression
identifier "Directory"
. "."
identifier "CreateDirectory"
argument_list
( "("
argument
identifier "newTmpdir"
, ","
argument
identifier "dirSecurity"
) ")"
; ";"
#endif "#endif"
expression_statement
assignment_expression
identifier "tmpdir"
= "="
identifier "newTmpdir"
; ";"
if_statement
if "if"
( "("
prefix_unary_expression
! "!"
identifier "KeepRemoteFiles"
) ")"
expression_statement
invocation_expression
member_access_expression
identifier "cleanupFiles"
. "."
identifier "Add"
argument_list
( "("
argument
identifier "tmpdir"
) ")"
; ";"
preproc_else
#else "#else"
throw_statement
throw "throw"
object_creation_expression
new "new"
identifier "NotImplementedException"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content "Tmpdir is only supported on Windows"
" "\""
) ")"
; ";"
#endif "#endif"
} "}"
return_statement
return "return"
identifier "tmpdir"
; ";"
} "}"
} "}"
constructor_declaration (+692 nodes collapsed)
method_declaration (+51 nodes collapsed)
method_declaration (+43 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+105 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+125 nodes collapsed)
method_declaration (+47 nodes collapsed)
method_declaration (+29 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+33 nodes collapsed)
method_declaration (+328 nodes collapsed)
method_declaration (+400 nodes collapsed)
method_declaration (+56 nodes collapsed)
method_declaration (+31 nodes collapsed)
method_declaration
modifier
public "public"
modifier
static "static"
identifier "T"
identifier "FromJson"
type_parameter_list
< "<"
type_parameter
identifier "T"
> ">"
parameter_list
( "("
parameter
predefined_type "string"
identifier "json"
) ")"
block
{ "{"
preproc_if
#if "#if"
identifier "CORECLR"
try_statement
try "try"
block
{ "{"
if_statement
if "if"
( "("
binary_expression
binary_expression
typeof_expression
typeof "typeof"
( "("
identifier "T"
) ")"
== "=="
typeof_expression
typeof "typeof"
( "("
predefined_type "object"
) ")"
|| "||"
binary_expression
typeof_expression
typeof "typeof"
( "("
identifier "T"
) ")"
== "=="
typeof_expression
typeof "typeof"
( "("
generic_name
identifier "Dictionary"
type_argument_list
< "<"
predefined_type "string"
, ","
predefined_type "object"
> ">"
) ")"
) ")"
block
{ "{"
using_statement
using "using"
( "("
variable_declaration
identifier "JsonDocument"
variable_declarator
identifier "doc"
= "="
invocation_expression
member_access_expression
identifier "JsonDocument"
. "."
identifier "Parse"
argument_list
( "("
argument
identifier "json"
) ")"
) ")"
block
{ "{"
return_statement
return "return"
cast_expression
( "("
identifier "T"
) ")"
cast_expression
( "("
predefined_type "object"
) ")"
invocation_expression
identifier "ConvertJsonElement"
argument_list
( "("
argument
member_access_expression
identifier "doc"
. "."
identifier "RootElement"
) ")"
; ";"
} "}"
} "}"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "JsonSerializer"
. "."
generic_name
identifier "Deserialize"
type_argument_list
< "<"
identifier "T"
> ">"
argument_list
( "("
argument
identifier "json"
) ")"
; ";"
} "}"
catch_clause
catch "catch"
catch_declaration
( "("
identifier "JsonException"
identifier "e"
) ")"
block
{ "{"
comment "// For backwards compatibility with JavaScriptSerializer, we"
comment "// use ArgumentException instead."
throw_statement
throw "throw"
object_creation_expression
new "new"
identifier "ArgumentException"
argument_list
( "("
argument
invocation_expression
member_access_expression
identifier "String"
. "."
identifier "Format"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content "Failed to parse JSON: {0}"
" "\""
, ","
argument
member_access_expression
identifier "e"
. "."
identifier "Message"
) ")"
, ","
argument
identifier "e"
) ")"
; ";"
} "}"
preproc_else (+57 nodes collapsed)
#endif "#endif"
} "}"
preproc_if
#if "#if"
identifier "CORECLR"
method_declaration
modifier
private "private"
modifier
static "static"
predefined_type "object"
identifier "ConvertJsonElement"
parameter_list
( "("
parameter
identifier "JsonElement"
identifier "element"
) ")"
block
{ "{"
switch_statement
switch "switch"
( "("
member_access_expression
identifier "element"
. "."
identifier "ValueKind"
) ")"
switch_body
{ "{"
switch_section
case "case"
constant_pattern
member_access_expression
identifier "JsonValueKind"
. "."
identifier "Object"
: ":"
local_declaration_statement
variable_declaration
implicit_type
var "var"
variable_declarator
identifier "dict"
= "="
object_creation_expression
new "new"
generic_name
identifier "Dictionary"
type_argument_list
< "<"
predefined_type "string"
, ","
predefined_type "object"
> ">"
argument_list
( "("
) ")"
; ";"
foreach_statement
foreach "foreach"
( "("
identifier "JsonProperty"
identifier "prop"
in "in"
invocation_expression
member_access_expression
identifier "element"
. "."
identifier "EnumerateObject"
argument_list
( "("
) ")"
) ")"
block
{ "{"
expression_statement
assignment_expression
element_access_expression
identifier "dict"
bracketed_argument_list
[ "["
argument
member_access_expression
identifier "prop"
. "."
identifier "Name"
] "]"
= "="
invocation_expression
identifier "ConvertJsonElement"
argument_list
( "("
argument
member_access_expression
identifier "prop"
. "."
identifier "Value"
) ")"
; ";"
} "}"
return_statement
return "return"
identifier "dict"
; ";"
switch_section
case "case"
constant_pattern
member_access_expression
identifier "JsonValueKind"
. "."
identifier "Array"
: ":"
comment "// We use ArrayList to copy JavaScriptSerializer behavior"
local_declaration_statement
variable_declaration
implicit_type
var "var"
variable_declarator
identifier "list"
= "="
object_creation_expression
new "new"
identifier "ArrayList"
argument_list
( "("
) ")"
; ";"
foreach_statement
foreach "foreach"
( "("
identifier "JsonElement"
identifier "item"
in "in"
invocation_expression
member_access_expression
identifier "element"
. "."
identifier "EnumerateArray"
argument_list
( "("
) ")"
) ")"
block
{ "{"
expression_statement
invocation_expression
member_access_expression
identifier "list"
. "."
identifier "Add"
argument_list
( "("
argument
invocation_expression
identifier "ConvertJsonElement"
argument_list
( "("
argument
identifier "item"
) ")"
) ")"
; ";"
} "}"
return_statement
return "return"
identifier "list"
; ";"
switch_section
case "case"
constant_pattern
member_access_expression
identifier "JsonValueKind"
. "."
identifier "String"
: ":"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "element"
. "."
identifier "GetString"
argument_list
( "("
) ")"
; ";"
switch_section
case "case"
constant_pattern
member_access_expression
identifier "JsonValueKind"
. "."
identifier "Number"
: ":"
if_statement
if "if"
( "("
invocation_expression
member_access_expression
identifier "element"
. "."
identifier "TryGetInt32"
argument_list
( "("
argument
out "out"
declaration_expression
predefined_type "int"
identifier "i"
) ")"
) ")"
return_statement
return "return"
identifier "i"
; ";"
else "else"
if_statement
if "if"
( "("
invocation_expression
member_access_expression
identifier "element"
. "."
identifier "TryGetInt64"
argument_list
( "("
argument
out "out"
declaration_expression
predefined_type "long"
identifier "l"
) ")"
) ")"
return_statement
return "return"
identifier "l"
; ";"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "element"
. "."
identifier "GetDecimal"
argument_list
( "("
) ")"
; ";"
switch_section
case "case"
constant_pattern
member_access_expression
identifier "JsonValueKind"
. "."
identifier "True"
: ":"
return_statement
return "return"
boolean_literal
true "true"
; ";"
switch_section
case "case"
constant_pattern
member_access_expression
identifier "JsonValueKind"
. "."
identifier "False"
: ":"
return_statement
return "return"
boolean_literal
false "false"
; ";"
switch_section
case "case"
constant_pattern
member_access_expression
identifier "JsonValueKind"
. "."
identifier "Null"
: ":"
return_statement
return "return"
null_literal "null"
; ";"
switch_section
default "default"
: ":"
throw_statement
throw "throw"
object_creation_expression
new "new"
identifier "ArgumentException"
argument_list
( "("
argument
interpolated_string_expression
interpolation_start "$"
" "\""
string_content "Unsupported JsonElement type: "
interpolation
interpolation_brace "{"
member_access_expression
identifier "element"
. "."
identifier "ValueKind"
interpolation_brace "}"
" "\""
) ")"
; ";"
} "}"
} "}"
#endif "#endif"
method_declaration
modifier
public "public"
modifier
static "static"
predefined_type "string"
identifier "ToJson"
parameter_list
( "("
parameter
predefined_type "object"
identifier "obj"
) ")"
block
{ "{"
comment "// Using PowerShell to serialize the JSON is preferable over"...
comment "// PS Objects a lot better than the alternatives. In case we"...
comment "// fallback to the other libraries as we won't be dealing wi"...
if_statement
if "if"
( "("
binary_expression
member_access_expression
identifier "Runspace"
. "."
identifier "DefaultRunspace"
!= "!="
null_literal "null"
) ")"
block (+48 nodes collapsed)
else "else"
block
{ "{"
preproc_if
#if "#if"
identifier "CORECLR"
return_statement
return "return"
invocation_expression
member_access_expression
identifier "JsonSerializer"
. "."
identifier "Serialize"
argument_list
( "("
argument
identifier "obj"
) ")"
; ";"
preproc_else (+52 nodes collapsed)
#endif "#endif"
} "}"
} "}"
method_declaration (+188 nodes collapsed)
method_declaration (+209 nodes collapsed)
method_declaration (+728 nodes collapsed)
method_declaration (+70 nodes collapsed)
method_declaration (+71 nodes collapsed)
method_declaration (+103 nodes collapsed)
method_declaration
modifier
public "public"
modifier
static "static"
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "object"
> ">"
identifier "ParseList"
parameter_list
( "("
parameter
predefined_type "object"
identifier "value"
) ")"
block
{ "{"
if_statement
if "if"
( "("
binary_expression
identifier "value"
== "=="
null_literal "null"
) ")"
return_statement
return "return"
null_literal "null"
; ";"
local_declaration_statement
variable_declaration
identifier "Type"
variable_declarator
identifier "valueType"
= "="
invocation_expression
member_access_expression
identifier "value"
. "."
identifier "GetType"
argument_list
( "("
) ")"
; ";"
if_statement
if "if"
( "("
binary_expression (+25 nodes collapsed)
) ")"
return_statement
return "return"
cast_expression
( "("
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "object"
> ">"
) ")"
identifier "value"
; ";"
else "else"
if_statement
if "if"
( "("
binary_expression
identifier "valueType"
== "=="
typeof_expression
typeof "typeof"
( "("
identifier "ArrayList"
) ")"
) ")"
return_statement (+30 nodes collapsed)
else "else"
if_statement
if "if"
( "("
member_access_expression
identifier "valueType"
. "."
identifier "IsArray"
) ")"
return_statement (+22 nodes collapsed)
else "else"
if_statement
if "if"
( "("
binary_expression
identifier "valueType"
== "=="
typeof_expression
typeof "typeof"
( "("
predefined_type "string"
) ")"
) ")"
return_statement (+54 nodes collapsed)
else "else"
if_statement
if "if"
( "("
binary_expression any 1:2
binary_expression any 1:2
identifier "valueType"
== "=="
typeof_expression
typeof "typeof"
( "("
predefined_type "int"
) ")"
|| "||"
binary_expression
identifier "valueType"
== "=="
typeof_expression
typeof "typeof"
( "("
predefined_type "long"
) ")"
) ")"
return_statement
return "return"
object_creation_expression
new "new"
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "object"
> ">"
argument_list
( "("
) ")"
initializer_expression
{ "{"
identifier "value"
} "}"
; ";"
else "else"
throw_statement (+29 nodes collapsed)
} "}"
method_declaration (+122 nodes collapsed)
method_declaration
modifier
public "public"
modifier
static "static"
predefined_type "object"
identifier "ParseRaw"
parameter_list
( "("
parameter
predefined_type "object"
identifier "value"
) ")"
block
{ "{"
return_statement
return "return"
identifier "value"
; ";"
} "}"
method_declaration (+92 nodes collapsed)
method_declaration (+27 nodes collapsed)
method_declaration (+1076 nodes collapsed)
method_declaration (+187 nodes collapsed)
method_declaration (+284 nodes collapsed)
method_declaration (+876 nodes collapsed)
method_declaration (+366 nodes collapsed)
method_declaration (+1041 nodes collapsed)
method_declaration
modifier
private "private"
predefined_type "void"
identifier "CheckUnsupportedArguments"
parameter_list
( "("
parameter
identifier "IDictionary"
identifier "param"
, ","
parameter
generic_name
identifier "List"
type_argument_list
< "<"
predefined_type "string"
> ">"
identifier "legalInputs"
) ")"
block
{ "{"
local_declaration_statement (+23 nodes collapsed)
local_declaration_statement (+23 nodes collapsed)
local_declaration_statement (+23 nodes collapsed)
foreach_statement (+441 nodes collapsed)
foreach_statement
foreach "foreach"
( "("
predefined_type "string"
identifier "parameter"
in "in"
identifier "removedParameters"
) ")"
expression_statement
invocation_expression
member_access_expression
identifier "param"
. "."
identifier "Remove"
argument_list
( "("
argument
identifier "parameter"
) ")"
; ";"
if_statement
if "if"
( "("
binary_expression
binary_expression
member_access_expression
identifier "unsupportedParameters"
. "."
identifier "Count"
> ">"
integer_literal "0"
&& "&&"
prefix_unary_expression
! "!"
identifier "ignoreUnknownOpts"
) ")"
block
{ "{"
expression_statement (+44 nodes collapsed)
local_declaration_statement
variable_declaration
generic_name
identifier "IEnumerable"
type_argument_list
< "<"
predefined_type "string"
> ">"
variable_declarator
identifier "unsupportedSorted"
= "="
invocation_expression
member_access_expression
identifier "unsupportedParameters"
. "."
identifier "OrderBy"
argument_list
( "("
argument
lambda_expression
implicit_parameter "s"
=> "=>"
identifier "s"
, ","
argument
member_access_expression
identifier "StringComparer"
. "."
identifier "Ordinal"
) ")"
; ";"
local_declaration_statement
variable_declaration
generic_name
identifier "IEnumerable"
type_argument_list
< "<"
predefined_type "string"
> ">"
variable_declarator
identifier "legalInputsSorted"
= "="
invocation_expression
member_access_expression
identifier "legalInputs"
. "."
identifier "OrderBy"
argument_list
( "("
argument
lambda_expression
implicit_parameter "s"
=> "=>"
identifier "s"
, ","
argument
member_access_expression
identifier "StringComparer"
. "."
identifier "Ordinal"
) ")"
; ";"
local_declaration_statement
variable_declaration
predefined_type "string"
variable_declarator
identifier "msg"
= "="
invocation_expression
member_access_expression
identifier "String"
. "."
identifier "Format"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content "Unsupported parameters for ({0}) module: {1}"
" "\""
, ","
argument
identifier "ModuleName"
, ","
argument
invocation_expression
member_access_expression
identifier "String"
. "."
identifier "Join"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content ", "
" "\""
, ","
argument
identifier "unsupportedSorted"
) ")"
) ")"
; ";"
expression_statement
assignment_expression
identifier "msg"
= "="
invocation_expression
member_access_expression
identifier "String"
. "."
identifier "Format"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content "{0}. Supported parameters include: {1}"
" "\""
, ","
argument
invocation_expression
identifier "FormatOptionsContext"
argument_list
( "("
argument
identifier "msg"
) ")"
, ","
argument
invocation_expression
member_access_expression
identifier "String"
. "."
identifier "Join"
argument_list
( "("
argument
string_literal
" "\""
string_literal_content ", "
" "\""
, ","
argument
identifier "legalInputsSorted"
) ")"
) ")"
; ";"
expression_statement
invocation_expression
identifier "FailJson"
argument_list
( "("
argument
identifier "msg"
) ")"
; ";"
} "}"
comment "/*\n // Uncomment when we want to start warning us"...
comment "// Make sure we convert all the incorrect case params to the"...
foreach_statement (+93 nodes collapsed)
} "}"
method_declaration (+178 nodes collapsed)
method_declaration (+254 nodes collapsed)
method_declaration (+235 nodes collapsed)
method_declaration (+178 nodes collapsed)
method_declaration (+449 nodes collapsed)
method_declaration (+233 nodes collapsed)
method_declaration (+526 nodes collapsed)
method_declaration (+317 nodes collapsed)
method_declaration (+213 nodes collapsed)
method_declaration (+316 nodes collapsed)
method_declaration (+279 nodes collapsed)
method_declaration (+517 nodes collapsed)
method_declaration (+178 nodes collapsed)
method_declaration (+77 nodes collapsed)
method_declaration (+26 nodes collapsed)
method_declaration (+113 nodes collapsed)
method_declaration (+28 nodes collapsed)
} "}"
preproc_if
#if "#if"
identifier "WINDOWS"
comment "// Windows is tricky as AVs and other software might still"
comment "// have an open handle to files causing a failure. Use a"
comment "// custom deletion mechanism to remove the files/dirs."
comment "// https://github.com/ansible/ansible/pull/80247"
class_declaration
modifier
internal "internal"
modifier
static "static"
class "class"
identifier "FileCleaner"
declaration_list
{ "{"
field_declaration
modifier
private "private"
modifier
const "const"
variable_declaration
predefined_type "int"
variable_declarator
identifier "FileDispositionInformation"
= "="
integer_literal "13"
; ";"
field_declaration
modifier
private "private"
modifier
const "const"
variable_declaration
predefined_type "int"
variable_declarator
identifier "FileDispositionInformationEx"
= "="
integer_literal "64"
; ";"
field_declaration
modifier
private "private"
modifier
const "const"
variable_declaration
predefined_type "int"
variable_declarator
identifier "ERROR_INVALID_PARAMETER"
= "="
integer_literal "0x00000057"
; ";"
field_declaration
modifier
private "private"
modifier
const "const"
variable_declaration
predefined_type "int"
variable_declarator
identifier "ERROR_DIR_NOT_EMPTY"
= "="
integer_literal "0x00000091"
; ";"
field_declaration
modifier
private "private"
modifier
static "static"
variable_declaration
nullable_type
predefined_type "bool"
? "?"
variable_declarator
identifier "_supportsPosixDelete"
= "="
null_literal "null"
; ";"
struct_declaration
attribute_list
[ "["
attribute
identifier "StructLayout"
attribute_argument_list
( "("
attribute_argument
member_access_expression
identifier "LayoutKind"
. "."
identifier "Sequential"
) ")"
] "]"
modifier
public "public"
struct "struct"
identifier "IO_STATUS_BLOCK"
declaration_list
{ "{"
field_declaration
modifier
public "public"
variable_declaration
predefined_type "int"
variable_declarator
identifier "Status"
; ";"
field_declaration
modifier
public "public"
variable_declaration
identifier "IntPtr"
variable_declarator
identifier "Information"
; ";"
} "}"
enum_declaration (+49 nodes collapsed)
enum_declaration (+74 nodes collapsed)
method_declaration (+80 nodes collapsed)
method_declaration (+176 nodes collapsed)
method_declaration
attribute_list
[ "["
attribute
identifier "DllImport"
attribute_argument_list
( "("
attribute_argument
string_literal
" "\""
string_literal_content "Ntdll.dll"
" "\""
) ")"
] "]"
modifier
private "private"
modifier
static "static"
modifier
extern "extern"
predefined_type "int"
identifier "NtSetInformationFile"
parameter_list
( "("
parameter
identifier "SafeFileHandle"
identifier "FileHandle"
, ","
parameter
modifier "ref"
identifier "IO_STATUS_BLOCK"
identifier "IoStatusBlock"
, ","
parameter
modifier "ref"
predefined_type "int"
identifier "FileInformation"
, ","
parameter
predefined_type "int"
identifier "Length"
, ","
parameter
predefined_type "int"
identifier "FileInformationClass"
) ")"
; ";"
method_declaration (+29 nodes collapsed)
method_declaration (+442 nodes collapsed)
method_declaration (+257 nodes collapsed)
method_declaration
modifier
private "private"
modifier
static "static"
predefined_type "void"
identifier "SetInformationFile"
parameter_list
( "("
parameter
identifier "SafeFileHandle"
identifier "handle"
, ","
parameter
predefined_type "int"
identifier "infoClass"
, ","
parameter
predefined_type "int"
identifier "value"
) ")"
block
{ "{"
local_declaration_statement
variable_declaration
identifier "IO_STATUS_BLOCK"
variable_declarator
identifier "ioStatusBlock"
= "="
object_creation_expression
new "new"
identifier "IO_STATUS_BLOCK"
argument_list
( "("
) ")"
; ";"
local_declaration_statement
variable_declaration
predefined_type "int"
variable_declarator
identifier "ntStatus"
= "="
invocation_expression
identifier "NtSetInformationFile"
argument_list
( "("
argument
identifier "handle"
, ","
argument
ref "ref"
identifier "ioStatusBlock"
, ","
argument
ref "ref"
identifier "value"
, ","
argument
invocation_expression
member_access_expression
identifier "Marshal"
. "."
identifier "SizeOf"
argument_list
( "("
argument
typeof_expression
typeof "typeof"
( "("
predefined_type "int"
) ")"
) ")"
, ","
argument
identifier "infoClass"
) ")"
; ";"
if_statement (+110 nodes collapsed)
if_statement
if "if"
( "("
binary_expression
identifier "infoClass"
== "=="
identifier "FileDispositionInformationEx"
) ")"
block
{ "{"
expression_statement
assignment_expression
identifier "_supportsPosixDelete"
= "="
boolean_literal
true "true"
; ";"
} "}"
} "}"
} "}"
#endif "#endif"
} "}"