Skip to content

Commit 64c1c84

Browse files
authored
Merge pull request #470 from Inxton/469-new-feature-update-deps-stc-11155
[NEW-FEATURE] Update deps. stc 11.1.55
2 parents a720793 + d5f931b commit 64c1c84

File tree

14 files changed

+676
-552
lines changed

14 files changed

+676
-552
lines changed

src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs

Lines changed: 82 additions & 67 deletions
Large diffs are not rendered by default.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// AXSharp.Compiler
2+
// Copyright (c) 2023 MTS spol. s r.o., and Contributors. All Rights Reserved.
3+
// Contributors: https://github.com/inxton/axsharp/graphs/contributors
4+
// See the LICENSE file in the repository root for more information.
5+
// https://github.com/inxton/axsharp/blob/dev/LICENSE
6+
// Third party licenses: https://github.com/inxton/axsharp/blob/master/notices.md
7+
8+
namespace AXSharp.Compiler.Core;
9+
10+
/// <summary>
11+
/// Represents a void/unit return type for the semantic node visitor pattern.
12+
/// Used as the TResult type parameter when the visitor doesn't need to return a meaningful value.
13+
/// </summary>
14+
public readonly struct Unit : IEquatable<Unit>
15+
{
16+
/// <summary>
17+
/// Gets the single value of the Unit type.
18+
/// </summary>
19+
public static readonly Unit Default = default;
20+
21+
/// <inheritdoc />
22+
public bool Equals(Unit other) => true;
23+
24+
/// <inheritdoc />
25+
public override bool Equals(object? obj) => obj is Unit;
26+
27+
/// <inheritdoc />
28+
public override int GetHashCode() => 0;
29+
30+
/// <inheritdoc />
31+
public override string ToString() => "()";
32+
33+
/// <summary>
34+
/// Determines whether two Unit values are equal (always true).
35+
/// </summary>
36+
public static bool operator ==(Unit left, Unit right) => true;
37+
38+
/// <summary>
39+
/// Determines whether two Unit values are not equal (always false).
40+
/// </summary>
41+
public static bool operator !=(Unit left, Unit right) => false;
42+
}

src/AXSharp.compiler/src/AXSharp.Compiler/LegalAcrobatics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ private static void SetupAssemblyResolverLegalAcrobatics(string entryAssemblyLoc
4646

4747
AXAssemblies = axAssemblies;
4848

49-
StcVersion = AXAssemblies.FirstOrDefault()?.GetName().Version?.ToString();
49+
StcVersion = AXAssemblies.FirstOrDefault(p => p.GetName().FullName.StartsWith("AX.ST.Semantic"))?.GetName().Version?.ToString();
5050

5151

5252

src/AXSharp.compiler/src/ixc/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ private static void DisplayInfo()
111111

112112

113113
Console.ForegroundColor = ConsoleColor.Magenta;
114-
Console.WriteLine($"Using version '> {LegalAcrobatics.StcVersion}' of stc.");
114+
Console.WriteLine($"Using version '{LegalAcrobatics.StcVersion}' of stc.");
115115
Console.ForegroundColor = originalColor;
116116

117117
if (int.Parse(GitVersionInformation.Major) < 1 || string.IsNullOrEmpty(GitVersionInformation.PreReleaseLabel))

src/AXSharp.compiler/src/ixd/Helpers/YamlHelpers.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private string GetTextFromXml(XmlNode element, PropertyInfo? prop)
205205
}
206206

207207
//create toc schema, grouped if namespace exists, or only global
208-
public void AddToTocSchema(MyNodeVisitor visitor, TocSchema.Item tocSchemaItem, string? tocGroup)
208+
public void AddToTocSchema(DocNodeVisitor visitor, TocSchema.Item tocSchemaItem, string? tocGroup)
209209
{
210210
if (tocGroup == null || tocGroup == "" || tocGroup == "$GLOBAL")
211211
{
@@ -255,7 +255,7 @@ public string GetAssembly(string projectFile)
255255
}
256256

257257
//add references of inherited members
258-
public void AddReferences(string[] references, MyNodeVisitor v)
258+
public void AddReferences(string[] references, DocNodeVisitor v)
259259
{
260260
foreach (var member in references)
261261
{
@@ -300,7 +300,7 @@ public Reference CreateNamespaceReference(IDeclaration declaration)
300300
};
301301
}
302302
//add general reference
303-
public void AddReference(IDeclaration declaration, MyNodeVisitor v)
303+
public void AddReference(IDeclaration declaration, DocNodeVisitor v)
304304
{
305305
if (v.YamlHelper.References.Where(a => a.Uid == Helpers.GetBaseUid(declaration)).Count() > 0)
306306
return;

src/AXSharp.compiler/src/ixd/Interfaces/IYamlBuiderVisitor.cs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,91 +19,91 @@ public interface IYamlBuiderVisitor
1919
/// </summary>
2020
/// <param name="fileSyntax">File syntax node.</param>
2121
/// <param name="visitor">Associated visitor.</param>
22-
public virtual void CreateFile(IFileSyntax fileSyntax, MyNodeVisitor visitor)
22+
public virtual void CreateFile(IFileSyntax fileSyntax, DocNodeVisitor visitor)
2323
{
2424
throw new NotImplementedException();
2525
}
2626

2727
public virtual void CreateNamespaceYaml(
2828
INamespaceDeclaration namespaceDeclaration,
29-
MyNodeVisitor visitor)
29+
DocNodeVisitor visitor)
3030
{
3131
throw new NotImplementedException();
3232
}
3333

3434
public virtual void CreateClassYaml(
3535
IClassDeclaration classDeclaration,
36-
MyNodeVisitor visitor)
36+
DocNodeVisitor visitor)
3737
{
3838
throw new NotImplementedException();
3939
}
4040

4141
public virtual void CreateFieldYaml(
4242
IFieldDeclaration fieldDeclaration,
43-
MyNodeVisitor visitor)
43+
DocNodeVisitor visitor)
4444
{
4545
throw new NotImplementedException();
4646
}
4747

4848
public virtual void CreateMethodYaml(
4949
IMethodDeclaration methodDeclaration,
50-
MyNodeVisitor visitor)
50+
DocNodeVisitor visitor)
5151
{
5252
throw new NotImplementedException();
5353
}
5454

5555
public virtual void CreateNamedValueTypeYaml(
5656
INamedValueTypeDeclaration namedValueTypeDeclaration,
57-
MyNodeVisitor visitor)
57+
DocNodeVisitor visitor)
5858
{
5959
throw new NotImplementedException();
6060
}
6161

6262
public virtual void CreateEnumTypeYaml(
6363
IEnumTypeDeclaration enumTypeDeclaration,
64-
MyNodeVisitor myNodeVisitor)
64+
DocNodeVisitor myNodeVisitor)
6565
{
6666
throw new NotImplementedException();
6767
}
6868

6969
void CreateNamedValueYaml(
7070
INamedValueDeclaration namedValueDeclaration,
71-
MyNodeVisitor myNodeVisitor)
71+
DocNodeVisitor myNodeVisitor)
7272
{
7373
throw new NotImplementedException();
7474
}
7575

7676
void CreateEnumValueYaml(
7777
IEnumValueDeclaration enumValueDeclaration,
78-
MyNodeVisitor myNodeVisitor)
78+
DocNodeVisitor myNodeVisitor)
7979
{
8080
throw new NotImplementedException();
8181
}
8282

8383
public virtual void CreateInterfaceYaml(
8484
IInterfaceDeclaration InterfaceDeclaration,
85-
MyNodeVisitor visitor)
85+
DocNodeVisitor visitor)
8686
{
8787
throw new NotImplementedException();
8888
}
8989

9090
public virtual void CreateMethodPrototypeYaml(
9191
IMethodPrototypeDeclaration methodPrototypeDeclaration,
92-
MyNodeVisitor visitor)
92+
DocNodeVisitor visitor)
9393
{
9494
throw new NotImplementedException();
9595
}
9696

9797
public virtual void CreateFunctionYaml(
9898
IFunctionDeclaration functionDeclaration,
99-
MyNodeVisitor visitor)
99+
DocNodeVisitor visitor)
100100
{
101101
throw new NotImplementedException();
102102
}
103103

104104
void CreateStructuredTypeYaml(
105105
IStructuredTypeDeclaration structuredTypeDeclaration,
106-
MyNodeVisitor visitor)
106+
DocNodeVisitor visitor)
107107
{
108108
throw new NotImplementedException();
109109
}

src/AXSharp.compiler/src/ixd/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void GenerateYamls(Options o)
8282
var semanticTree = compilation.Compilation.GetSemanticTree();
8383

8484
//visit
85-
var myNodeVisitor = new MyNodeVisitor();
85+
var myNodeVisitor = new DocNodeVisitor();
8686
var yamlSerializer = new YamlSerializer(o);
8787
var treeWalker = new YamlBuilder(yamlSerializer);
8888

0 commit comments

Comments
 (0)