package ast import ( "fmt" "code.jmug.me/jmug/interpreter-in-go/pkg/token" ) type IndexExpression struct { Token token.Token // The "[" token Left Expression Index Expression } func (ie *IndexExpression) expressionNode() {} func (ie *IndexExpression) TokenLiteral() string { return ie.Token.Literal } func (ie *IndexExpression) String() string { return fmt.Sprintf("(%s[%s])", ie.Left.String(), ie.Index.String()) }