2023-07-02 20:56:50 +00:00
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
// THIS FILE IS GENERATED. //
|
|
|
|
// DO NOT EDIT. //
|
|
|
|
////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#nullable enable
|
|
|
|
|
|
|
|
namespace Finn.AST;
|
|
|
|
|
|
|
|
public abstract record Pattern() {
|
2023-07-11 06:51:51 +00:00
|
|
|
public abstract TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor);
|
2023-07-02 20:56:50 +00:00
|
|
|
}
|
2023-07-11 06:51:51 +00:00
|
|
|
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);
|
2023-07-02 20:56:50 +00:00
|
|
|
}
|
2023-07-02 22:37:06 +00:00
|
|
|
public partial record SimplePattern(Name? Identifier) : Pattern()
|
2023-07-02 20:56:50 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
|
2023-07-02 20:56:50 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitSimplePatternPattern(context, this);
|
2023-07-02 20:56:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
public partial record VariantPattern(Name Tag, Pattern? Argument) : Pattern()
|
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
|
2023-07-02 20:56:50 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitVariantPatternPattern(context, this);
|
2023-07-02 20:56:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
public partial record FieldPattern(Name Name, Pattern? Pattern) : Pattern()
|
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
|
2023-07-02 20:56:50 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitFieldPatternPattern(context, this);
|
2023-07-02 20:56:50 +00:00
|
|
|
}
|
|
|
|
}
|
2023-07-02 22:37:06 +00:00
|
|
|
public partial record RecordPattern(FieldPattern[] Fields, SimplePattern? Rest) : Pattern()
|
2023-07-02 20:56:50 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
|
2023-07-02 20:56:50 +00:00
|
|
|
{
|
2023-07-11 06:51:51 +00:00
|
|
|
return visitor.visitRecordPatternPattern(context, this);
|
2023-07-02 20:56:50 +00:00
|
|
|
}
|
|
|
|
}
|