Skip to content

[MilCodeGen] Allow emitting empty-lines via NULL, including conditionals #10856

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 109 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
8596bab
cherry-pick from milcodegen-newline
h3xds1nz Apr 4, 2025
4d85472
summaries + ctors + attributes
h3xds1nz May 17, 2025
4717d45
non-freezable collections mcg edit
h3xds1nz May 17, 2025
4b15278
non-freezable collections run
h3xds1nz May 17, 2025
a4498c9
clone-collection empty mcg edit
h3xds1nz May 17, 2025
1adeaf5
clone-collection empty run
h3xds1nz May 17, 2025
0e1e6ac
non-collection enumerator mcg edit
h3xds1nz May 17, 2025
6df7a35
non-collection enumerator run
h3xds1nz May 17, 2025
1e43ce8
collection-methods mcg edit
h3xds1nz May 17, 2025
b1a16a1
collection-methods run
h3xds1nz May 17, 2025
b6a8ee9
collection fields mcg edit
h3xds1nz May 17, 2025
00ee749
collection fields run
h3xds1nz May 17, 2025
b4d64ee
update resource + balance out other newlines (mcg edit)
h3xds1nz May 17, 2025
2ff2d3a
update resource + balance out other newlines (run)
h3xds1nz May 17, 2025
9cba173
remove-freezable-at removal + compensation (mcg edit)
h3xds1nz May 17, 2025
e359371
remove-freezable-at removal + compensation (run)
h3xds1nz May 17, 2025
3c2055a
create-instance-core newline (mcg edit)
h3xds1nz May 17, 2025
66f5dae
create-instance-core newline (run)
h3xds1nz May 17, 2025
4b7a4c6
add-ref-on-channel new-line (mcg edit)
h3xds1nz May 17, 2025
450fff8
add-ref-on-channel new-line (run)
h3xds1nz May 17, 2025
5a63c46
release add-ref-on-channel (mcg edit)
h3xds1nz May 17, 2025
b71df8b
release add-ref-on-channel (run)
h3xds1nz May 17, 2025
e28efa8
get-duce-resource (mcg edit)
h3xds1nz May 17, 2025
ade5c7b
get-duce-resource (run)
h3xds1nz May 17, 2025
7a9385c
get-channel-count (mcg edit)
h3xds1nz May 17, 2025
b3d964f
get-channel-count (run)
h3xds1nz May 17, 2025
305f4d5
get-channel (mcg edit)
h3xds1nz May 17, 2025
fbde553
get-channel (run)
h3xds1nz May 17, 2025
b28fd61
write-update-resource (mcg edit)
h3xds1nz May 17, 2025
e45893b
write-update-resource (run)
h3xds1nz May 17, 2025
cce14c5
write-resource-handle-field (mcg edit)
h3xds1nz May 17, 2025
a228346
write-resource-handle-field (run)
h3xds1nz May 17, 2025
04b16a6
write-skip-properties (mcg edit)
h3xds1nz May 17, 2025
26fac7d
write-skip-properties (run)
h3xds1nz May 17, 2025
d19f856
write-effective-values (mcg edit)
h3xds1nz May 17, 2025
7e376e2
write-effective-values (run)
h3xds1nz May 17, 2025
d80b49d
write-static-ctor (mcg edit)
h3xds1nz May 17, 2025
72a909d
write-static-ctor (run)
h3xds1nz May 17, 2025
b6780be
write-default-values (mcg edit)
h3xds1nz May 17, 2025
73df843
write-default-values (run)
h3xds1nz May 17, 2025
598f580
write-cache-decls (mcg edit)
h3xds1nz May 17, 2025
52f421e
write-cache-decls (run)
h3xds1nz May 17, 2025
efce53b
write-local-cached-props (mcg edit)
h3xds1nz May 17, 2025
9f79496
write-local-cached-props (run)
h3xds1nz May 17, 2025
d6f0448
write-register-dps (mcg edit)
h3xds1nz May 17, 2025
08e38b7
write-register-dps (run)
h3xds1nz May 17, 2025
c9c04a9
write-local-props-delegates (mcg edit)
h3xds1nz May 17, 2025
81a40f9
write-local-props-delegates (run)
h3xds1nz May 17, 2025
6c24087
write-properties v2 (mcg edit + simplify cs-empty checks)
h3xds1nz May 17, 2025
f659062
write-properties v2 (run)
h3xds1nz May 17, 2025
0375a16
write-resource-handle-v2 (mcg edit)
h3xds1nz May 17, 2025
39473e9
write-resource-handle-v2 (run)
h3xds1nz May 17, 2025
690a7bd
write-list-marshalling (mcg edit)
h3xds1nz May 17, 2025
7b612aa
write-list-marshalling (run)
h3xds1nz May 17, 2025
ea0d20f
write-parse (mcg edit + FIX FORMATTING)
h3xds1nz May 17, 2025
a6994d5
write-parse (run)
h3xds1nz May 17, 2025
9cc1485
write-clone-core-methods (mcg edit)
h3xds1nz May 17, 2025
4b9c766
write-clone-core-methods (run)
h3xds1nz May 17, 2025
7397d8d
freeze-core (mcg edit)
h3xds1nz May 17, 2025
698c78a
freeze-core (run)
h3xds1nz May 17, 2025
38ceb71
write-collection-events v2 (mcg edit)
h3xds1nz May 17, 2025
fe89332
write-collection-events v2 (run)
h3xds1nz May 17, 2025
5e00a21
collection-set-value (whitespace on indxers + newline removal) [mcg e…
h3xds1nz May 17, 2025
1be1d72
collection-set-value (whitespace on indxers + newline removal) [run]
h3xds1nz May 17, 2025
529a308
check-null-insert (mcg edit)
h3xds1nz May 17, 2025
73e8f95
check-null-insert (run)
h3xds1nz May 17, 2025
1ffdf5a
final indexers/setters in collections (+ SA1508 compliance) [mcg edit]
h3xds1nz May 17, 2025
f61f7de
final indexers/setters in collections (+ SA1508 compliance) [run]
h3xds1nz May 17, 2025
ef47319
collection-on-insert [mcg edit]
h3xds1nz May 17, 2025
db83441
collection-on-insert [run]
h3xds1nz May 17, 2025
aea771e
check-null-property-changed [mcg edit]
h3xds1nz May 17, 2025
19fd160
check-null-property-changed [run]
h3xds1nz May 17, 2025
a78b2d0
write-clone [mcg edit]
h3xds1nz May 17, 2025
58f9b37
write-clone [run]
h3xds1nz May 17, 2025
43de143
write-clone-current-value [mcg edit]
h3xds1nz May 17, 2025
e2f2c90
write-clone-current-value [run]
h3xds1nz May 17, 2025
d86d7f3
write-object-methods [mcg edit]
h3xds1nz May 17, 2025
34ec0d3
write-object-methods [run]
h3xds1nz May 17, 2025
1f0de49
one more whitespace [mcg-edit]
h3xds1nz May 17, 2025
1c5f78e
one more whitespace [run]
h3xds1nz May 17, 2025
f416289
on-inheritace-core [mcg-edit]
h3xds1nz May 17, 2025
467010a
on-inheritace-core [run]
h3xds1nz May 17, 2025
e88b3ea
write-to-string [mcg edit]
h3xds1nz May 17, 2025
711e9d4
write-to-string [run]
h3xds1nz May 17, 2025
e246742
add-ref-on-channel-core [mcg-edit]
h3xds1nz May 17, 2025
0d69c92
add-ref-on-channel-core [run]
h3xds1nz May 17, 2025
a2e26b1
add-ref / remove-ref on channel [mcg edit]
h3xds1nz May 17, 2025
ea19796
add-ref / remove-ref on channel [run]
h3xds1nz May 17, 2025
f9725d7
to-string-whitespace [mcg-edit]
h3xds1nz May 17, 2025
26ebe5f
to-string-whitespace [run]
h3xds1nz May 17, 2025
4798c4b
spline-key-frames whitespace [mcg-edit]
h3xds1nz May 17, 2025
18fc9af
spline-key-frames whitespace [run]
h3xds1nz May 17, 2025
e061795
fix-property-newlines-blocks [mcg edit]
h3xds1nz May 17, 2025
6eb23c2
fix-property-newlines-blocks [run]
h3xds1nz May 17, 2025
1960eb2
Support conditionals to trim whitespaces [mcg-edit]
h3xds1nz May 18, 2025
b51c2e0
Support conditionals to trim whitespaces [run]
h3xds1nz May 18, 2025
ecd9344
key-frame-template [mcg-edit]
h3xds1nz May 18, 2025
b7ba9b7
key-frame-template [run]
h3xds1nz May 18, 2025
c8ffa9c
key-frame-collection [mcg-edit]
h3xds1nz May 18, 2025
1da9115
key-frame-collection [run]
h3xds1nz May 18, 2025
4162c2d
easing-key-frames [mcg-edit]
h3xds1nz May 18, 2025
61a2e28
easing-key-frames [run]
h3xds1nz May 18, 2025
a66a371
empty-update-resource [mcg-edit]
h3xds1nz May 18, 2025
a8fcdb7
empty-update-resource [run]
h3xds1nz May 18, 2025
f6f7842
begin-command-clean [mcg-edit]
h3xds1nz May 18, 2025
46a761b
begin-command-clean [run]
h3xds1nz May 18, 2025
754cdc8
final-collection-cleanup [mcg-edit]
h3xds1nz May 18, 2025
9e87ee4
final-keyframe-cleanup [mcg-edit]
h3xds1nz May 18, 2025
3aca357
final-keyframe-cleanup [run]
h3xds1nz May 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public sealed partial class TextDecoration : Animatable
}




#endregion Public Methods

//------------------------------------------------------
Expand All @@ -55,8 +53,6 @@ public sealed partial class TextDecoration : Animatable
//------------------------------------------------------




#region Public Properties

/// <summary>
Expand Down Expand Up @@ -158,8 +154,6 @@ protected override Freezable CreateInstanceCore()
return new TextDecoration();
}



#endregion ProtectedMethods

//------------------------------------------------------
Expand All @@ -171,13 +165,6 @@ protected override Freezable CreateInstanceCore()
#region Internal Methods









#endregion Internal Methods

//------------------------------------------------------
Expand All @@ -189,9 +176,6 @@ protected override Freezable CreateInstanceCore()
#region Internal Properties





#endregion Internal Properties

//------------------------------------------------------
Expand Down Expand Up @@ -233,10 +217,6 @@ protected override Freezable CreateInstanceCore()

#region Internal Fields





internal const double c_PenOffset = 0.0;
internal const TextDecorationUnit c_PenOffsetUnit = TextDecorationUnit.FontRecommended;
internal const TextDecorationUnit c_PenThicknessUnit = TextDecorationUnit.FontRecommended;
Expand All @@ -245,7 +225,6 @@ protected override Freezable CreateInstanceCore()
#endregion Internal Fields



#region Constructors

//------------------------------------------------------
Expand Down Expand Up @@ -312,7 +291,6 @@ static TextDecoration()
}



#endregion Constructors
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ namespace System.Windows
/// <summary>
/// A collection of TextDecoration objects.
/// </summary>

public sealed partial class TextDecorationCollection : Animatable, IList, IList<TextDecoration>
{
//------------------------------------------------------
Expand Down Expand Up @@ -48,8 +47,6 @@ public sealed partial class TextDecorationCollection : Animatable, IList, IList<
}




#endregion Public Methods

//------------------------------------------------------
Expand All @@ -58,7 +55,6 @@ public sealed partial class TextDecorationCollection : Animatable, IList, IList<
//
//------------------------------------------------------


#region IList<T>

/// <summary>
Expand Down Expand Up @@ -125,8 +121,6 @@ public void Insert(int index, TextDecoration value)

_collection.Insert(index, value);



++_version;
WritePostscript();
}
Expand Down Expand Up @@ -156,9 +150,6 @@ public bool Remove(TextDecoration value)

_collection.RemoveAt(index);




++_version;
WritePostscript();

Expand All @@ -183,7 +174,6 @@ public void RemoveAt(int index)
WritePostscript();
}


/// <summary>
/// Removes the element at the specified index without firing
/// the public Changed event.
Expand All @@ -200,15 +190,11 @@ internal void RemoveAtWithoutFiringPublicEvents(int index)

_collection.RemoveAt(index);




++_version;

// No WritePostScript to avoid firing the Changed event.
}


/// <summary>
/// Indexer for the collection
/// </summary>
Expand All @@ -229,18 +215,15 @@ public TextDecoration this[int index]

WritePreamble();

if (!Object.ReferenceEquals(_collection[ index ], value))
if (!Object.ReferenceEquals(_collection[index], value))
{
TextDecoration oldValue = _collection[index];

TextDecoration oldValue = _collection[ index ];
OnFreezablePropertyChanged(oldValue, value);

_collection[ index ] = value;


_collection[index] = value;
}


++_version;
WritePostscript();
}
Expand Down Expand Up @@ -522,22 +505,20 @@ internal int AddWithoutFiringPublicEvents(TextDecoration value)
{
throw new System.ArgumentException(SR.Collection_NoNull);
}

WritePreamble();
TextDecoration newValue = value;

OnFreezablePropertyChanged(/* oldValue = */ null, newValue);
index = _collection.Add(newValue);



++_version;

// No WritePostScript to avoid firing the Changed event.

return index;
}



#endregion Private Helpers

private static TextDecorationCollection s_empty;
Expand All @@ -546,7 +527,6 @@ internal int AddWithoutFiringPublicEvents(TextDecoration value)
#region Public Properties



#endregion Public Properties

//------------------------------------------------------
Expand Down Expand Up @@ -581,11 +561,10 @@ protected override void CloneCore(Freezable source)
for (int i = 0; i < count; i++)
{
TextDecoration newValue = (TextDecoration)sourceTextDecorationCollection._collection[i].Clone();

OnFreezablePropertyChanged(/* oldValue = */ null, newValue);
_collection.Add(newValue);

}

}
/// <summary>
/// Implementation of Freezable.CloneCurrentValueCore()
Expand All @@ -603,11 +582,10 @@ protected override void CloneCurrentValueCore(Freezable source)
for (int i = 0; i < count; i++)
{
TextDecoration newValue = (TextDecoration)sourceTextDecorationCollection._collection[i].CloneCurrentValue();

OnFreezablePropertyChanged(/* oldValue = */ null, newValue);
_collection.Add(newValue);

}

}
/// <summary>
/// Implementation of Freezable.GetAsFrozenCore()
Expand All @@ -625,11 +603,10 @@ protected override void GetAsFrozenCore(Freezable source)
for (int i = 0; i < count; i++)
{
TextDecoration newValue = (TextDecoration)sourceTextDecorationCollection._collection[i].GetAsFrozen();

OnFreezablePropertyChanged(/* oldValue = */ null, newValue);
_collection.Add(newValue);

}

}
/// <summary>
/// Implementation of Freezable.GetCurrentValueAsFrozenCore()
Expand All @@ -647,11 +624,10 @@ protected override void GetCurrentValueAsFrozenCore(Freezable source)
for (int i = 0; i < count; i++)
{
TextDecoration newValue = (TextDecoration)sourceTextDecorationCollection._collection[i].GetCurrentValueAsFrozen();

OnFreezablePropertyChanged(/* oldValue = */ null, newValue);
_collection.Add(newValue);

}

}
/// <summary>
/// Implementation of <see cref="System.Windows.Freezable.FreezeCore">Freezable.FreezeCore</see>.
Expand Down Expand Up @@ -680,13 +656,6 @@ protected override bool FreezeCore(bool isChecking)
#region Internal Methods









#endregion Internal Methods

//------------------------------------------------------
Expand All @@ -698,9 +667,6 @@ protected override bool FreezeCore(bool isChecking)
#region Internal Properties





#endregion Internal Properties

//------------------------------------------------------
Expand All @@ -712,7 +678,6 @@ protected override bool FreezeCore(bool isChecking)
#region Dependency Properties



#endregion Dependency Properties

//------------------------------------------------------
Expand All @@ -723,13 +688,9 @@ protected override bool FreezeCore(bool isChecking)

#region Internal Fields




internal FrugalStructList<TextDecoration> _collection;
internal uint _version = 0;


#endregion Internal Fields

#region Enumerator
Expand Down Expand Up @@ -866,7 +827,6 @@ public TextDecoration Current
//
//------------------------------------------------------


/// <summary>
/// Initializes a new instance that is empty.
/// </summary>
Expand Down Expand Up @@ -922,10 +882,11 @@ public TextDecorationCollection(IEnumerable<TextDecoration> collection)
{
throw new System.ArgumentException(SR.Collection_NoNull);
}

TextDecoration newValue = item;

OnFreezablePropertyChanged(/* oldValue = */ null, newValue);
_collection.Add(newValue);

}

needsItemValidation = false;
Expand All @@ -940,12 +901,11 @@ public TextDecorationCollection(IEnumerable<TextDecoration> collection)
{
throw new System.ArgumentException(SR.Collection_NoNull);
}
OnFreezablePropertyChanged(/* oldValue = */ null, item);

OnFreezablePropertyChanged(/* oldValue = */ null, item);
}
}


WritePostscript();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,6 @@ protected sealed override Boolean GetCurrentValueCore(
currentIterationValue = GetResolvedKeyFrame(currentResolvedKeyFrameIndex).InterpolateValue(fromValue, currentSegmentProgress);
}



return currentIterationValue;
}

Expand Down Expand Up @@ -517,7 +515,6 @@ public bool ShouldSerializeKeyFrames()
#endregion



#region Private Methods

private struct KeyTimeBlock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ protected override void CloneCore(Freezable sourceFreezable)
}
}


/// <summary>
/// Implementation of <see cref="System.Windows.Freezable.CloneCurrentValueCore(System.Windows.Freezable)">Freezable.CloneCurrentValueCore</see>.
/// </summary>
Expand All @@ -126,7 +125,6 @@ protected override void CloneCurrentValueCore(Freezable sourceFreezable)
}
}


/// <summary>
/// Implementation of <see cref="System.Windows.Freezable.GetAsFrozenCore(System.Windows.Freezable)">Freezable.GetAsFrozenCore</see>.
/// </summary>
Expand All @@ -147,7 +145,6 @@ protected override void GetAsFrozenCore(Freezable sourceFreezable)
}
}


/// <summary>
/// Implementation of <see cref="System.Windows.Freezable.GetCurrentValueAsFrozenCore(System.Windows.Freezable)">Freezable.GetCurrentValueAsFrozenCore</see>.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ protected sealed override Byte GetCurrentValueCore(
}



// If we're cumulative, we need to multiply the final key frame
// value by the current repeat count and add this to the return
// value.
Expand All @@ -444,7 +443,6 @@ protected sealed override Byte GetCurrentValueCore(
return AnimatedTypeHelpers.AddByte(defaultOriginValue, currentIterationValue);
}


return currentIterationValue;
}

Expand Down
Loading