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 T accept<T>(IPatternVisitor<T> visitor);
|
|
|
|
}
|
|
|
|
public interface IPatternVisitor<T> {
|
2023-07-02 22:37:06 +00:00
|
|
|
T visitSimplePatternPattern(SimplePattern pattern);
|
2023-07-02 20:56:50 +00:00
|
|
|
T visitVariantPatternPattern(VariantPattern pattern);
|
|
|
|
T visitFieldPatternPattern(FieldPattern pattern);
|
|
|
|
T visitRecordPatternPattern(RecordPattern pattern);
|
|
|
|
}
|
2023-07-02 22:37:06 +00:00
|
|
|
public partial record SimplePattern(Name? Identifier) : Pattern()
|
2023-07-02 20:56:50 +00:00
|
|
|
{
|
|
|
|
public override T accept<T>(IPatternVisitor<T> visitor)
|
|
|
|
{
|
2023-07-02 22:37:06 +00:00
|
|
|
return visitor.visitSimplePatternPattern(this);
|
2023-07-02 20:56:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
public partial record VariantPattern(Name Tag, Pattern? Argument) : Pattern()
|
|
|
|
{
|
|
|
|
public override T accept<T>(IPatternVisitor<T> visitor)
|
|
|
|
{
|
|
|
|
return visitor.visitVariantPatternPattern(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
public partial record FieldPattern(Name Name, Pattern? Pattern) : Pattern()
|
|
|
|
{
|
|
|
|
public override T accept<T>(IPatternVisitor<T> visitor)
|
|
|
|
{
|
|
|
|
return visitor.visitFieldPatternPattern(this);
|
|
|
|
}
|
|
|
|
}
|
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
|
|
|
{
|
|
|
|
public override T accept<T>(IPatternVisitor<T> visitor)
|
|
|
|
{
|
|
|
|
return visitor.visitRecordPatternPattern(this);
|
|
|
|
}
|
|
|
|
}
|