Add more semantic fields to Match and Case

This commit is contained in:
Sasha Koshka 2024-03-04 14:09:48 -05:00
parent 18b6329ee5
commit beefbd5ce7
2 changed files with 4 additions and 1 deletions

View File

@ -371,7 +371,9 @@ type Match struct {
Cases []*Case
// Semantics
Ty Type
Ty Type
CaseOrder []Hash
CaseMap map[Hash] *Case
}
func (*Match) expression(){}
func (this *Match) Type () Type { return this.Ty }

View File

@ -80,6 +80,7 @@ type Case struct {
Position errors.Position
Declaration *Declaration
Expression
Scope
}
func (this *Case) String () string {
return fmt.Sprint("| ", this.Declaration, this.Expression)