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
Original file line number Diff line number Diff line change
Expand Up @@ -1177,8 +1177,11 @@ public interface IConditionalOperation : IOperation
/// </summary>
IOperation? WhenFalse { get; }
/// <summary>
/// Is result a managed reference
/// <see langword="true" /> if the result is by-reference.
/// </summary>
/// <remarks>
/// This occurs in C# for ternaries whose branches use <see langword="ref" />.
/// </remarks>
bool IsRef { get; }
}
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,7 +1137,7 @@
</Property>
<Property Name="IsRef" Type="bool">
<Comments>
<value><see langword="true"/> if the result is by-reference.</value>
<summary><see langword="true"/> if the result is by-reference.</summary>
<remarks>This occurs in C# for ternaries whose branches use <see langword="ref"/>.</remarks>
</Comments>
</Property>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ private IOperationClassWriter(Tree tree, string location)
_typeMap.Add("IOperation", null);
}

public static void Write(Tree tree, string location)
/// <summary>Returns true for success</summary>
public static bool Write(Tree tree, string location)
{
new IOperationClassWriter(tree, location).WriteFiles();
return new IOperationClassWriter(tree, location).WriteFiles();
}

#region Writing helpers
Expand Down Expand Up @@ -90,12 +91,13 @@ private void Outdent()
}
#endregion

private void WriteFiles()
/// <summary>Returns true for success</summary>
private bool WriteFiles()
{
if (ModelHasErrors(_tree))
{
Console.WriteLine("Encountered xml errors, not generating");
return;
return false;
}

foreach (var grouping in _tree.Types.OfType<AbstractNode>().GroupBy(n => n.Namespace))
Expand Down Expand Up @@ -171,6 +173,8 @@ private void WriteFiles()
WriteEndNamespace();
}

return true;

void writeHeader()
{
WriteLine("// Licensed to the .NET Foundation under one or more agreements.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Collections.Generic;
using System.Diagnostics;
using System.Xml;
using System.Xml.Serialization;

Expand All @@ -24,6 +25,7 @@ public class Tree
public List<TreeType> Types;
}

[DebuggerDisplay("{Name, nq}")]
public class TreeType
{
[XmlAttribute]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,4 @@
return 1;
}

IOperationClassWriter.Write(tree, outFilePath);

return 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch ...

return IOperationClassWriter.Write(tree, outFilePath) ? 0 : 1;
Loading