finn-lang/Pattern.g.cs

47 lines
1.8 KiB
C#

////////////////////////////////////////////////////////////
// THIS FILE IS GENERATED. //
// DO NOT EDIT. //
////////////////////////////////////////////////////////////
#nullable enable
namespace Finn.AST;
public abstract record Pattern() {
public abstract TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor);
}
public interface IPatternVisitor<TContext, TResult> {
TResult visitSimplePatternPattern(TContext context, SimplePattern pattern);
TResult visitVariantPatternPattern(TContext context, VariantPattern pattern);
TResult visitFieldPatternPattern(TContext context, FieldPattern pattern);
TResult visitRecordPatternPattern(TContext context, RecordPattern pattern);
}
public partial record SimplePattern(Name? Identifier) : Pattern()
{
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
{
return visitor.visitSimplePatternPattern(context, this);
}
}
public partial record VariantPattern(Name Tag, Pattern? Argument) : Pattern()
{
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
{
return visitor.visitVariantPatternPattern(context, this);
}
}
public partial record FieldPattern(Name Name, Pattern? Pattern) : Pattern()
{
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
{
return visitor.visitFieldPatternPattern(context, this);
}
}
public partial record RecordPattern(FieldPattern[] Fields, SimplePattern? Rest) : Pattern()
{
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
{
return visitor.visitRecordPatternPattern(context, this);
}
}