optimizations
This commit is contained in:
@@ -127,6 +127,7 @@ func (b *Boolean) expressionNode() {}
|
||||
func (b *Boolean) TokenLiteral() string { return b.Token.Literal }
|
||||
func (b *Boolean) String() string { return b.Token.Literal }
|
||||
|
||||
// IntegerLiteral represents a literal integer number and holds an int64 value
|
||||
type IntegerLiteral struct {
|
||||
Token token.Token
|
||||
Value int64
|
||||
@@ -136,6 +137,20 @@ func (il *IntegerLiteral) expressionNode() {}
|
||||
func (il *IntegerLiteral) TokenLiteral() string { return il.Token.Literal }
|
||||
func (il *IntegerLiteral) String() string { return il.Token.Literal }
|
||||
|
||||
// FloatLiteral represents a literal floating point number and holds an float64 value
|
||||
type FloatLiteral struct {
|
||||
Token token.Token
|
||||
Value float64
|
||||
}
|
||||
|
||||
func (fl *FloatLiteral) expressionNode() {}
|
||||
|
||||
// TokenLiteral prints the literal value of the token associated with this node
|
||||
func (fl *FloatLiteral) TokenLiteral() string { return fl.Token.Literal }
|
||||
|
||||
// String returns a stringified version of the AST for debugging
|
||||
func (fl *FloatLiteral) String() string { return fl.Token.Literal }
|
||||
|
||||
type PrefixExpression struct {
|
||||
Token token.Token // The prefix token, e.g. !
|
||||
Operator string
|
||||
|
||||
Reference in New Issue
Block a user