-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
685 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
#nullable enable | ||
#pragma warning disable CS0108 | ||
using System.Diagnostics; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Rewrite.Core; | ||
using Rewrite.Core.Marker; | ||
using FileAttributes = Rewrite.Core.FileAttributes; | ||
using Rewrite.RewriteJava.Tree; | ||
|
||
namespace Rewrite.RewriteCSharp.Tree; | ||
|
||
[SuppressMessage("ReSharper", "InconsistentNaming")] | ||
[SuppressMessage("ReSharper", "PossibleUnintendedReferenceComparison")] | ||
[SuppressMessage("ReSharper", "InvertIf")] | ||
[SuppressMessage("ReSharper", "RedundantExtendsListEntry")] | ||
[SuppressMessage("ReSharper", "UnusedMember.Global")] | ||
[SuppressMessage("ReSharper", "RedundantNameQualifier")] | ||
public partial interface Cs : J | ||
{ | ||
#if DEBUG_VISITOR | ||
[DebuggerStepThrough] | ||
#endif | ||
public partial class TupleElement( | ||
Guid id, | ||
Space prefix, | ||
Markers markers, | ||
TypeTree type, | ||
J.Identifier? name | ||
) : Cs, MutableTree<TupleElement> | ||
{ | ||
public J? AcceptCSharp<P>(CSharpVisitor<P> v, P p) | ||
{ | ||
return v.VisitTupleElement(this, p); | ||
} | ||
|
||
public Guid Id => id; | ||
|
||
public TupleElement WithId(Guid newId) | ||
{ | ||
return newId == id ? this : new TupleElement(newId, prefix, markers, type, name); | ||
} | ||
public Space Prefix => prefix; | ||
|
||
public TupleElement WithPrefix(Space newPrefix) | ||
{ | ||
return newPrefix == prefix ? this : new TupleElement(id, newPrefix, markers, type, name); | ||
} | ||
public Markers Markers => markers; | ||
|
||
public TupleElement WithMarkers(Markers newMarkers) | ||
{ | ||
return ReferenceEquals(newMarkers, markers) ? this : new TupleElement(id, prefix, newMarkers, type, name); | ||
} | ||
public TypeTree Type => type; | ||
|
||
public TupleElement WithType(TypeTree newType) | ||
{ | ||
return ReferenceEquals(newType, type) ? this : new TupleElement(id, prefix, markers, newType, name); | ||
} | ||
public J.Identifier? Name => name; | ||
|
||
public TupleElement WithName(J.Identifier? newName) | ||
{ | ||
return ReferenceEquals(newName, name) ? this : new TupleElement(id, prefix, markers, type, newName); | ||
} | ||
#if DEBUG_VISITOR | ||
[DebuggerStepThrough] | ||
#endif | ||
public bool Equals(Rewrite.Core.Tree? other) | ||
{ | ||
return other is TupleElement && other.Id == Id; | ||
} | ||
#if DEBUG_VISITOR | ||
[DebuggerStepThrough] | ||
#endif | ||
public override int GetHashCode() | ||
{ | ||
return Id.GetHashCode(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
#nullable enable | ||
#pragma warning disable CS0108 | ||
using System.Diagnostics; | ||
using System.Diagnostics.CodeAnalysis; | ||
using Rewrite.Core; | ||
using Rewrite.Core.Marker; | ||
using FileAttributes = Rewrite.Core.FileAttributes; | ||
using Rewrite.RewriteJava.Tree; | ||
|
||
namespace Rewrite.RewriteCSharp.Tree; | ||
|
||
[SuppressMessage("ReSharper", "InconsistentNaming")] | ||
[SuppressMessage("ReSharper", "PossibleUnintendedReferenceComparison")] | ||
[SuppressMessage("ReSharper", "InvertIf")] | ||
[SuppressMessage("ReSharper", "RedundantExtendsListEntry")] | ||
[SuppressMessage("ReSharper", "UnusedMember.Global")] | ||
[SuppressMessage("ReSharper", "RedundantNameQualifier")] | ||
public partial interface Cs : J | ||
{ | ||
#if DEBUG_VISITOR | ||
[DebuggerStepThrough] | ||
#endif | ||
public partial class TupleType( | ||
Guid id, | ||
Space prefix, | ||
Markers markers, | ||
JContainer<TupleElement> elements, | ||
JavaType? type | ||
) : Cs, TypeTree, Expression, MutableTree<TupleType> | ||
{ | ||
[NonSerialized] private WeakReference<PaddingHelper>? _padding; | ||
|
||
public PaddingHelper Padding | ||
{ | ||
get | ||
{ | ||
PaddingHelper? p; | ||
if (_padding == null) | ||
{ | ||
p = new PaddingHelper(this); | ||
_padding = new WeakReference<PaddingHelper>(p); | ||
} | ||
else | ||
{ | ||
_padding.TryGetTarget(out p); | ||
if (p == null || p.T != this) | ||
{ | ||
p = new PaddingHelper(this); | ||
_padding.SetTarget(p); | ||
} | ||
} | ||
return p; | ||
} | ||
} | ||
|
||
public J? AcceptCSharp<P>(CSharpVisitor<P> v, P p) | ||
{ | ||
return v.VisitTupleType(this, p); | ||
} | ||
|
||
public Guid Id => id; | ||
|
||
public TupleType WithId(Guid newId) | ||
{ | ||
return newId == id ? this : new TupleType(newId, prefix, markers, _elements, type); | ||
} | ||
public Space Prefix => prefix; | ||
|
||
public TupleType WithPrefix(Space newPrefix) | ||
{ | ||
return newPrefix == prefix ? this : new TupleType(id, newPrefix, markers, _elements, type); | ||
} | ||
public Markers Markers => markers; | ||
|
||
public TupleType WithMarkers(Markers newMarkers) | ||
{ | ||
return ReferenceEquals(newMarkers, markers) ? this : new TupleType(id, prefix, newMarkers, _elements, type); | ||
} | ||
private readonly JContainer<Cs.TupleElement> _elements = elements; | ||
public IList<Cs.TupleElement> Elements => _elements.GetElements(); | ||
|
||
public TupleType WithElements(IList<Cs.TupleElement> newElements) | ||
{ | ||
return Padding.WithElements(JContainer<Cs.TupleElement>.WithElements(_elements, newElements)); | ||
} | ||
public JavaType? Type => type; | ||
|
||
public TupleType WithType(JavaType? newType) | ||
{ | ||
return newType == type ? this : new TupleType(id, prefix, markers, _elements, newType); | ||
} | ||
public sealed record PaddingHelper(Cs.TupleType T) | ||
{ | ||
public JContainer<Cs.TupleElement> Elements => T._elements; | ||
|
||
public Cs.TupleType WithElements(JContainer<Cs.TupleElement> newElements) | ||
{ | ||
return T._elements == newElements ? T : new Cs.TupleType(T.Id, T.Prefix, T.Markers, newElements, T.Type); | ||
} | ||
|
||
} | ||
|
||
#if DEBUG_VISITOR | ||
[DebuggerStepThrough] | ||
#endif | ||
public bool Equals(Rewrite.Core.Tree? other) | ||
{ | ||
return other is TupleType && other.Id == Id; | ||
} | ||
#if DEBUG_VISITOR | ||
[DebuggerStepThrough] | ||
#endif | ||
public override int GetHashCode() | ||
{ | ||
return Id.GetHashCode(); | ||
} | ||
} | ||
} |
Oops, something went wrong.