2015-01-11 21:38:45 +01:00
|
|
|
package ast
|
|
|
|
|
2015-01-11 22:59:24 +01:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
2015-01-11 21:38:45 +01:00
|
|
|
// LiteralNode represents a single literal value, such as "foo" or
|
|
|
|
// 42 or 3.14159. Based on the Type, the Value can be safely cast.
|
|
|
|
type LiteralNode struct {
|
|
|
|
Value interface{}
|
|
|
|
Type Type
|
|
|
|
}
|
2015-01-11 22:59:24 +01:00
|
|
|
|
|
|
|
func (n *LiteralNode) GoString() string {
|
|
|
|
return fmt.Sprintf("*%#v", *n)
|
|
|
|
}
|