Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 16 additions & 1 deletion src/AXSharp.compiler/src/AXSharp.Compiler/Core/IxNodeVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,22 @@ public void Accept(IArrayRepetitionInitializerSyntax arrayRepetitionInitializerS
void ISyntaxNodeVisitor<ICombinedThreeVisitor>.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<ICombinedThreeVisitor>.Accept(IAsmStatementSyntax asmStatementSyntax,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ public void CanCallAcceptForISyntaxNodeVisitor_ICombinedThreeVisitor_WithArrayTy
var data = new Mock<ICombinedThreeVisitor>().Object;

// Act
Assert.Throws<NotSupportedException>(() => ((ISyntaxNodeVisitor<ICombinedThreeVisitor>)_testClass).Accept(arrayTypeDeclarationSyntax, data));
((ISyntaxNodeVisitor<ICombinedThreeVisitor>)_testClass).Accept(arrayTypeDeclarationSyntax, data);

// Assert

Expand Down