diff --git a/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs b/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs index d4d6117f..da6138e2 100644 --- a/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs +++ b/src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs @@ -743,7 +743,22 @@ public void Accept(IArrayRepetitionInitializerSyntax arrayRepetitionInitializerS void ISyntaxNodeVisitor.Accept(IArrayTypeDeclarationSyntax arrayTypeDeclarationSyntax, ICombinedThreeVisitor data) { - throw new NotSupportedException(); + try + { + // Read Locations SourceText property using reflection. + var locationType = arrayTypeDeclarationSyntax.Location.GetType(); + var sourceTextProperty = locationType.GetProperty("SourceText"); + var sourceText = sourceTextProperty?.GetValue(arrayTypeDeclarationSyntax.Location); + var sourceTextType = sourceText?.GetType(); + var fileNameProperty = sourceTextType?.GetProperty("Filename") ?? sourceTextType?.GetProperty("FileName"); + var fileName = fileNameProperty?.GetValue(sourceText) as string ?? "unknown file"; + + Log.Logger.Warning($"Array types as declared in '{fileName}' are not supported at this time."); + } + catch (Exception) + { + Log.Logger.Warning($"Array types as declared in 'an unknown location' are not supported at this time."); + } } void ISyntaxNodeVisitor.Accept(IAsmStatementSyntax asmStatementSyntax, diff --git a/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json b/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json index c9a09360..03c4a8d4 100644 --- a/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json +++ b/src/AXSharp.compiler/src/ixc/Properties/launchSettings.json @@ -40,7 +40,7 @@ "axopen-traversal": { "commandName": "Project", "commandLineArgs": "--verbosity Information", - "workingDirectory": "C:\\W\\Develop\\gh\\inxton\\simatic-ax\\axopen.templates\\axopen\\src\\traversals\\apax\\" + "workingDirectory": "c:\\W\\Develop\\gh\\inxton\\simatic-ax\\axopen-1\\AXOpen\\src\\traversals\\apax\\" }, "axopen-core": { "commandName": "Project", diff --git a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTestsSemantics.cs b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTestsSemantics.cs index eed4d073..da4709ea 100644 --- a/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTestsSemantics.cs +++ b/src/AXSharp.compiler/tests/AXSharp.CompilerTests/Core/IxNodeVisitorTestsSemantics.cs @@ -921,7 +921,7 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithArrayTy var data = new Mock().Object; // Act - Assert.Throws(() => ((ISyntaxNodeVisitor)_testClass).Accept(arrayTypeDeclarationSyntax, data)); + ((ISyntaxNodeVisitor)_testClass).Accept(arrayTypeDeclarationSyntax, data); // Assert