File tree Expand file tree Collapse file tree 8 files changed +30
-70
lines changed
src/generators/Silk.NET.SilkTouch.Symbols Expand file tree Collapse file tree 8 files changed +30
-70
lines changed Original file line number Diff line number Diff line change @@ -6,27 +6,7 @@ namespace Silk.NET.SilkTouch.Symbols;
66/// <summary>
77/// A <see cref="FieldSymbol"/>. A field is simply a named location that can hold some type.
88/// </summary>
9+ /// <param name="Type">The <see cref="TypeSymbol"/> of the data stored in this field</param>
10+ /// <param name="Identifier">The Identifier of this field</param>
911/// <seealso cref="MemberSymbol"/>
10- public sealed class FieldSymbol : MemberSymbol
11- {
12- /// <summary>
13- /// Create a field symbol from the parent <see cref="TypeSymbol"/>, the type of the field and it's identifier
14- /// </summary>
15- /// <param name="type">The type of the data stored in this field</param>
16- /// <param name="identifier">The identifier of this field</param>
17- public FieldSymbol ( TypeSymbol type , IdentifierSymbol identifier )
18- {
19- Type = type ;
20- Identifier = identifier ;
21- }
22-
23- /// <summary>
24- /// The <see cref="TypeSymbol"/> of the data stored in this field
25- /// </summary>
26- public TypeSymbol Type { get ; }
27-
28- /// <summary>
29- /// The Identifier of this field
30- /// </summary>
31- public IdentifierSymbol Identifier { get ; }
32- }
12+ public sealed record FieldSymbol ( TypeSymbol Type , IdentifierSymbol Identifier ) : MemberSymbol ;
Original file line number Diff line number Diff line change @@ -6,20 +6,6 @@ namespace Silk.NET.SilkTouch.Symbols;
66/// <summary>
77/// An Identifier. Generally used to identify another symbol
88/// </summary>
9+ /// <param name="Value">The String Value of this identifier</param>
910/// <seealso cref="TypeSymbol"/>
10- public sealed class IdentifierSymbol : Symbol
11- {
12- /// <summary>
13- /// Create an <see cref="IdentifierSymbol"/> from a string
14- /// </summary>
15- /// <param name="value">The identifier as a string</param>
16- public IdentifierSymbol ( string value )
17- {
18- Value = value ;
19- }
20-
21- /// <summary>
22- /// The Value of this Identifier as a String
23- /// </summary>
24- public string Value { get ; }
25- }
11+ public sealed record IdentifierSymbol ( string Value ) : Symbol ;
Original file line number Diff line number Diff line change @@ -7,6 +7,4 @@ namespace Silk.NET.SilkTouch.Symbols;
77/// A <see cref="MemberSymbol"/>, representing a generic member of some <see cref="TypeSymbol"/>
88/// </summary>
99/// <seealso cref="FieldSymbol"/>
10- public abstract class MemberSymbol : Symbol
11- {
12- }
10+ public abstract record MemberSymbol : Symbol ;
Original file line number Diff line number Diff line change 1+ // Licensed to the .NET Foundation under one or more agreements.
2+ // The .NET Foundation licenses this file to you under the MIT license.
3+
4+ #if NETSTANDARD2_0
5+ using System . ComponentModel ;
6+
7+ // ReSharper disable once CheckNamespace
8+ namespace System . Runtime . CompilerServices
9+ {
10+ /// <summary>
11+ /// Reserved to be used by the compiler for tracking metadata.
12+ /// This class should not be used by developers in source code.
13+ /// </summary>
14+ [ EditorBrowsable ( EditorBrowsableState . Never ) ]
15+ internal static class IsExternalInit
16+ {
17+ }
18+ }
19+ #endif
Original file line number Diff line number Diff line change 55 <ImplicitUsings >enable</ImplicitUsings >
66 <Nullable >enable</Nullable >
77 </PropertyGroup >
8-
98</Project >
Original file line number Diff line number Diff line change @@ -6,25 +6,11 @@ namespace Silk.NET.SilkTouch.Symbols;
66/// <summary>
77/// A <see cref="TypeSymbol"/> representing a <c>struct</c>.
88/// </summary>
9+ /// <param name="Identifier">The Identifier of this struct</param>
910/// <remarks>
1011/// In this context, a Struct means a type that represents the layout of a continuous block of memory.
1112/// </remarks>
1213// /// Each meaningful place in this memory called a field (see <see cref="FieldSymbol"/>) is accessible via this type.
1314// /// Fields are allowed to overlap.
1415// /// Additionally it may contain one or multiple <see cref="MethodSymbol"/> that are called with an instance of this type as their first argument.
15- public sealed class StructSymbol : TypeSymbol
16- {
17- /// <summary>
18- /// Creates a struct symbol given it's identifier
19- /// </summary>
20- /// <param name="identifier">The identifier of the struct</param>
21- public StructSymbol ( IdentifierSymbol identifier )
22- {
23- Identifier = identifier ;
24- }
25-
26- /// <summary>
27- /// The identifier of this struct
28- /// </summary>
29- public override IdentifierSymbol Identifier { get ; }
30- }
16+ public sealed record StructSymbol ( IdentifierSymbol Identifier ) : TypeSymbol ( Identifier ) ;
Original file line number Diff line number Diff line change @@ -6,7 +6,4 @@ namespace Silk.NET.SilkTouch.Symbols;
66/// <summary>
77/// The base Symbol. Represents shared properties of all Symbols. Primarily used with <see cref="SymbolVisitor"/>
88/// </summary>
9- public abstract class Symbol
10- {
11-
12- }
9+ public abstract record Symbol ;
Original file line number Diff line number Diff line change @@ -6,11 +6,6 @@ namespace Silk.NET.SilkTouch.Symbols;
66/// <summary>
77/// A generic <see cref="Symbol"/> representing a named type.
88/// </summary>
9+ /// <param name="Identifier">The identifier of this type</param>
910/// <seealso cref="StructSymbol"/>
10- public abstract class TypeSymbol : Symbol
11- {
12- /// <summary>
13- /// The identifier of this type
14- /// </summary>
15- public abstract IdentifierSymbol Identifier { get ; }
16- }
11+ public abstract record TypeSymbol ( IdentifierSymbol Identifier ) : Symbol ;
You can’t perform that action at this time.
0 commit comments