Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

149 bug in some instances class is not correctly extended #151

Merged
merged 4 commits into from
Apr 12, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ public virtual void CreateScalarTypeDeclaration(IScalarTypeDeclaration scalarTyp
throw new NotImplementedException();
}


/// <summary>
/// Creates string type declaration.
/// </summary>
Expand All @@ -274,9 +273,16 @@ public virtual void CreateStringTypeDeclaration(IStringTypeDeclaration stringTyp
}

/// <summary>
/// Created array type declaration.
/// Creates array type declaration.
/// </summary>
/// <param name="arrayTypeDeclaration">Array type semantics</param>
/// <param name="visitor">Associated visitor.</param>
void CreateArrayTypeDeclaration(IArrayTypeDeclaration arrayTypeDeclaration, IxNodeVisitor visitor);

/// <summary>
/// Creates documentation for
/// </summary>
/// <param name="docComment">Documentation comment</param>
/// <param name="data">Associated visitor</param>
void CreateDocComment(IDocComment docComment, ICombinedThreeVisitor data);
}
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ void ISemanticNodeVisitor<ICombinedThreeVisitor>.Visit(ISemanticTypeAccess seman
data.CreateSemanticTypeAccess(semanticTypeAccess, this);
}

public void Visit(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
{
data.CreateDocComment(semanticTypeAccess, data);
}

void ISemanticNodeVisitor<ICombinedThreeVisitor>.Visit(ISemanticInstructionList instrList,
ICombinedThreeVisitor data)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,15 @@ public static bool IsMemberEligibleForConstructor(this IArrayTypeDeclaration arr
{
return arrayTypeDeclaration.ElementTypeAccess.Type.IsTypeEligibleForTranspile(sourceBuilder);
}

/// <summary>
/// Create triple-slash documentation.
/// </summary>
/// <param name="docComment">Documentation comment</param>
/// <param name="sourceBuilder">Source builder</param>
/// <returns></returns>
public static string AddDocumentationComment(this IDocComment docComment, ISourceBuilder sourceBuilder)
{
return docComment.Content;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,10 @@ public void AddTypeConstructionParameters(string parametersString)
{
AddToSource(parametersString);
}

/// <inheritdoc />
public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
{
AddToSource(semanticTypeAccess.AddDocumentationComment(SourceBuilder));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,10 @@ public static CsOnlinerMemberBuilder Create(IxNodeVisitor visitor, IConfiguratio
semantics.Variables.ToList().ForEach(p => p.Accept(visitor, builder));
return builder;
}

/// <inheritdoc />
public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
{
AddToSource(semanticTypeAccess.AddDocumentationComment(SourceBuilder));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,10 @@ public static CsOnlinerPlainerOnlineToPlainBuilder Create(IxNodeVisitor visitor,
builder.AddToSource($"}}");
return builder;
}

/// <inheritdoc />
public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
{
AddToSource(semanticTypeAccess.AddDocumentationComment(SourceBuilder));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,10 @@ public static CsOnlinerPlainerPlainToOnlineBuilder Create(IxNodeVisitor visitor,
builder.AddToSource($"}}");
return builder;
}

/// <inheritdoc />
public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
{
AddToSource(semanticTypeAccess.AddDocumentationComment(SourceBuilder));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,13 @@ public static CsOnlinerPlainerPlainToShadowBuilder Create(IxNodeVisitor visitor,
builder.AddToSource($"}}");
return builder;
}

/// <inheritdoc />
public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
{
AddToSource(semanticTypeAccess.AddDocumentationComment(SourceBuilder));
}
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,11 @@ public static CsOnlinerPlainerShadowToPlainBuilder Create(IxNodeVisitor visitor,
builder.AddToSource($"}}");
return builder;
}

/// <inheritdoc />
public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
{
AddToSource(semanticTypeAccess.AddDocumentationComment(SourceBuilder));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -309,4 +309,10 @@ private void AddToSource(string token, string separator = " ")
{
_sourceBuilder.Append($"{token}{separator}");
}

/// <inheritdoc />
public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
{
AddToSource(semanticTypeAccess.AddDocumentationComment(this));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ public void CreateArrayTypeDeclaration(IArrayTypeDeclaration arrayTypeDeclaratio
AddToSource("[]");
}

/// <inheritdoc />
public void CreateDocComment(IDocComment semanticTypeAccess, ICombinedThreeVisitor data)
{
AddToSource(semanticTypeAccess.AddDocumentationComment(this));
}

/// <inheritdoc />
public void CreateStringTypeDeclaration(IStringTypeDeclaration stringTypeDeclaration, IxNodeVisitor visitor)
{
Expand Down
5 changes: 5 additions & 0 deletions src/AXSharp.compiler/src/ixd/Visitors/MyNodeVisitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ public void Visit(ISemanticTypeAccess semanticTypeAccess, IYamlBuiderVisitor dat

}

public void Visit(IDocComment semanticTypeAccess, IYamlBuiderVisitor data)
{
throw new NotImplementedException();
}

public void Visit(ISemanticInstructionList instrList, IYamlBuiderVisitor data)
{

Expand Down
Loading