27 lines
560 B
Go
27 lines
560 B
Go
package ast
|
|
|
|
import "github.com/d5/tengo/compiler/source"
|
|
|
|
// IntLit represents an integer literal.
|
|
type IntLit struct {
|
|
Value int64
|
|
ValuePos source.Pos
|
|
Literal string
|
|
}
|
|
|
|
func (e *IntLit) exprNode() {}
|
|
|
|
// Pos returns the position of first character belonging to the node.
|
|
func (e *IntLit) Pos() source.Pos {
|
|
return e.ValuePos
|
|
}
|
|
|
|
// End returns the position of first character immediately after the node.
|
|
func (e *IntLit) End() source.Pos {
|
|
return source.Pos(int(e.ValuePos) + len(e.Literal))
|
|
}
|
|
|
|
func (e *IntLit) String() string {
|
|
return e.Literal
|
|
}
|