mirror of
https://github.com/RoBaertschi/tt.git
synced 2025-04-18 23:13:29 +00:00
better representation of ast and tast
This commit is contained in:
parent
8bb0bb9a4e
commit
d998ecfc42
@ -107,5 +107,5 @@ type BinaryExpression struct {
|
|||||||
func (be *BinaryExpression) expressionNode() {}
|
func (be *BinaryExpression) expressionNode() {}
|
||||||
func (be *BinaryExpression) TokenLiteral() string { return be.Token.Literal }
|
func (be *BinaryExpression) TokenLiteral() string { return be.Token.Literal }
|
||||||
func (be *BinaryExpression) String() string {
|
func (be *BinaryExpression) String() string {
|
||||||
return fmt.Sprintf("%s %s %s", be.Lhs, be.Operator, be.Rhs)
|
return fmt.Sprintf("%s %s %s", be.Lhs, be.Operator.SymbolString(), be.Rhs)
|
||||||
}
|
}
|
||||||
|
@ -89,5 +89,5 @@ func (be *BinaryExpression) Type() types.Type {
|
|||||||
}
|
}
|
||||||
func (be *BinaryExpression) TokenLiteral() string { return be.Token.Literal }
|
func (be *BinaryExpression) TokenLiteral() string { return be.Token.Literal }
|
||||||
func (be *BinaryExpression) String() string {
|
func (be *BinaryExpression) String() string {
|
||||||
return fmt.Sprintf("%s %s %s", be.Lhs, be.Operator, be.Rhs)
|
return fmt.Sprintf("(%s %s %s :> %s)", be.Lhs, be.Operator.SymbolString(), be.Rhs, be.ResultType.Name())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user