added Bind, Map and Match extensions generators
All checks were successful
.NET Test / test (push) Successful in 4m41s

This commit is contained in:
2023-11-28 21:41:01 +04:00
parent ac18863426
commit 6726ba07b3
8 changed files with 365 additions and 617 deletions

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using Microsoft.CodeAnalysis;
namespace Just.Railway.SourceGen;
[Generator]
public class ResultMethodGenerator : IIncrementalGenerator
{
private readonly IEnumerable<IGeneratorExecutor> _executors = new IGeneratorExecutor[]
{
new ResultCombineExecutor(),
new ResultMatchExecutor(),
new ResultMapExecutor(),
new ResultBindExecutor(),
};
public void Initialize(IncrementalGeneratorInitializationContext context)
{
foreach (var executor in _executors)
{
context.RegisterSourceOutput(context.CompilationProvider, executor.Execute);
}
}
}