source gen and ir gen now use the same seq generator
This commit is contained in:
@@ -18,6 +18,28 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace StgSharp.RegularAnalysis.Abstraction
|
||||
{
|
||||
public static class SequenceEmitterExtensions
|
||||
{
|
||||
|
||||
public static SequenceEmitter<string> AppendLine(
|
||||
this SequenceEmitter<string> emitter
|
||||
)
|
||||
{
|
||||
return emitter is null ? null! : emitter.Append(string.Empty);
|
||||
}
|
||||
|
||||
public static SequenceEmitter<string> AppendLine(
|
||||
this SequenceEmitter<string> emitter,
|
||||
string line
|
||||
)
|
||||
{
|
||||
return emitter is null ?
|
||||
null! :
|
||||
emitter.Append(string.IsNullOrEmpty(line) ? string.Empty : line);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public sealed class SequenceEmitter<T>
|
||||
{
|
||||
|
||||
@@ -35,6 +57,8 @@ namespace StgSharp.RegularAnalysis.Abstraction
|
||||
|
||||
public int Count { get; private set; }
|
||||
|
||||
private static bool IsString { get; } = typeof(T) == typeof(string);
|
||||
|
||||
public SequenceEmitter<T> Append(
|
||||
T unit
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user