finn-lang/Pattern.g.cs

47 lines
1.8 KiB
C#
Raw Normal View History

2023-07-02 20:56:50 +00:00
////////////////////////////////////////////////////////////
// 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);
2023-07-02 20:56:50 +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
}
public partial record SimplePattern(Token? Identifier) : Pattern()
2023-07-02 20:56:50 +00:00
{
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
2023-07-02 20:56:50 +00:00
{
return visitor.visitSimplePatternPattern(context, this);
2023-07-02 20:56:50 +00:00
}
}
public partial record VariantPattern(Token Tag, Pattern? Argument) : Pattern()
2023-07-02 20:56:50 +00:00
{
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
2023-07-02 20:56:50 +00:00
{
return visitor.visitVariantPatternPattern(context, this);
2023-07-02 20:56:50 +00:00
}
}
public partial record FieldPattern(Token Name, Pattern? Pattern) : Pattern()
2023-07-02 20:56:50 +00:00
{
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
2023-07-02 20:56:50 +00:00
{
return visitor.visitFieldPatternPattern(context, this);
2023-07-02 20:56:50 +00:00
}
}
public partial record RecordPattern(FieldPattern[] Fields, SimplePattern? Rest) : Pattern()
2023-07-02 20:56:50 +00:00
{
public override TResult accept<TContext, TResult>(TContext context, IPatternVisitor<TContext, TResult> visitor)
2023-07-02 20:56:50 +00:00
{
return visitor.visitRecordPatternPattern(context, this);
2023-07-02 20:56:50 +00:00
}
}