18 Commits
Author SHA1 Message Date
Siegfried Pammer d3517739ff Add fine-grained C# AST debug steps
Record AST transform groups and mutation steps through the C# pipeline, replay selected steps with the stepper, and carry modified-node ranges through output so the Debug Steps pane can highlight the selected mutation without replacing its full step tree.

Assisted-by: CodeAlta:gpt-5.5:CodeAlta
2026-07-02 01:08:51 +02:00
Siegfried Pammer 9285a7328d Delete the Role hierarchy; key the child API on SlotKind
Slot identity already lived in node.Slot/CSharpSlotInfo/SlotKind after
the storage flip, so the parallel Role/Role<T> child model was redundant.
The Role-keyed mutation/query API is reexpressed over SlotKind, and the
role-index packing on AstNode flags is gone.

Because a node's Slot is now derived from its index in its parent rather
than stored on the child, the located-AST reattach in
InsertMissingTokensDecorator must capture the child's slot kind before
Remove() detaches it.

Assisted-by: Claude:claude-opus-4-8:Claude Code
2026-06-23 07:43:42 +02:00
Siegfried Pammer 9aa0ddd37b Replace AST null-objects with nullable reference types
With every optional slot nullable, the null-object pattern is dead. Generated
non-nullable getters return the backing field directly, which surfaced a last
tier of slots the decompiler legitimately leaves empty (omitted range operands,
an implicitly-typed array creation, unnamed parameters, an unbound generic
argument, and others) and flips them to nullable too. The machinery is then
removed entirely: the per-node null classes, the .Null statics and
VisitNullNode, AstNode.IsNull, the role null object, and Identifier.Null.
AcceptVisitor becomes unconditionally generated, and consumers move from
.IsNull to is null and from unconditional visits to ?.AcceptVisitor.
Assisted-by: Claude:claude-opus-4-8:Claude Code
2026-06-23 07:43:42 +02:00
Siegfried Pammer 785e36712d Enable nullable reference types across the C# transforms
Turn on #nullable enable across the AST transform pipeline, ahead of
annotating the slot properties themselves. TransformContext now exposes the
nullable CurrentMember/CurrentTypeDefinition/CurrentModule contract already
declared by ITypeResolveContext, and the generated pattern-to-node conversion
returns a non-null node so patterns can be used in collection initializers
without warnings. No IL changes.
Assisted-by: Claude:claude-opus-4-8:Claude Code
2026-06-23 07:43:42 +02:00
Peter Crabtree e1e16b64f5 dev: Strip BOM mark from text files 2025-08-28 20:56:19 -04:00
ds5678 361bb17618 Add configuration option to check for overflow and underflow 2025-05-29 14:47:24 -07:00
Daniel Grunwald 7f985757a7 Fix #2541: Add explicit unchecked() around non-constant cast of constant to nint 2021-11-23 00:15:18 +01:00
dotnet format 0d9f871a4f #2128: Reformat the whole code base. 2020-08-28 01:05:38 +02:00
Siegfried Pammer 91af32ef94 Do not wrap local functions in checked blocks. 2019-07-26 19:16:28 +02:00
Daniel Grunwald 75a627d40b Don't use compound assignment when the RHS value does not fit into the LHS type. 2018-05-05 23:40:12 +02:00
Daniel Grunwald 905cb0f388 Split PrettifyAssignments pass out from ReplaceMethodCallsWithOperators and fix pass ordering.
This simplifies the code; and fixes the assertion during NewtonsoftJson_pcl_debug decompilation.
2017-09-12 00:06:04 +02:00
Siegfried Pammer 840ec04fde Namespace adjustments for Syntax classes 2016-11-26 12:06:58 +01:00
Christoph Wille 1ce8349dd9 Adjust namespaces 2016-11-26 11:12:53 +01:00
Daniel Grunwald eb48a3764e Fix various issues that caused conversions to decompile to code with different semantics:
* ensure constant expressions of small integer type have the correct type
* add checked/unchecked annotations for casts, so that we generate the appropriate checked/unchecked blocks
* avoid moving label statements into checked blocks
2016-06-13 00:33:54 +02:00
Daniel Grunwald 08a5e81517 Re-enable IntroduceUsingDeclarations 2014-11-16 15:41:35 +01:00
Daniel Grunwald 2f83334c2e Use NRefactory.TypeSystem for ILAst. 2014-11-16 09:29:05 +01:00
Daniel Grunwald 7e9f6bb9d6 Fix ConvertConstructorCallIntoInitializer transform. 2014-11-15 17:01:09 +01:00
Daniel Grunwald e0a1666547 Add back AST transform infrastructure 2014-09-21 12:22:47 +02:00