47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
////////////////////////////////////////////////////////////
|
|
// 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> {
|
|
T visitSimplePatternPattern(SimplePattern pattern);
|
|
T visitVariantPatternPattern(VariantPattern pattern);
|
|
T visitFieldPatternPattern(FieldPattern pattern);
|
|
T visitRecordPatternPattern(RecordPattern pattern);
|
|
}
|
|
public partial record SimplePattern(Name? Identifier) : Pattern()
|
|
{
|
|
public override T accept<T>(IPatternVisitor<T> visitor)
|
|
{
|
|
return visitor.visitSimplePatternPattern(this);
|
|
}
|
|
}
|
|
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);
|
|
}
|
|
}
|
|
public partial record RecordPattern(FieldPattern[] Fields, SimplePattern? Rest) : Pattern()
|
|
{
|
|
public override T accept<T>(IPatternVisitor<T> visitor)
|
|
{
|
|
return visitor.visitRecordPatternPattern(this);
|
|
}
|
|
}
|