func NewFloat(x float64) Float {
	return Float{Val: x}
}
NewFloat returns a Float instance with the given value.
package ast
import (
	"bytes"
	"strconv"
	"strings"
	"github.com/arnodel/golua/token"
)
func NewNumber(id *token.Token) (ExpNode, error) {
	loc := LocFromToken(id)
	nstring := string(id.Lit)
	if isFloatToken(id) {
		f, err := strconv.ParseFloat(nstring, 64)
		if err != nil {
			return nil, err
		}
		return Float{Location: loc, Val: f}, nil
	}
	var n uint64
	var err error
	if strings.HasPrefix(nstring, "0x") || strings.HasPrefix(nstring, "0X") {
		nstring = nstring[2:]
		if len(nstring) > 16 {
			nstring = nstring[len(nstring)-16:]
		}
		n, err = strconv.ParseUint(nstring, 16, 64)
	} else {
		n, err = strconv.ParseUint(nstring, 10, 64)
	}
	if err != nil {
		return nil, err
	}
	return Int{Location: loc, Val: n}, nil
}
func IsNumber(e ExpNode) bool {
	n, ok := e.(numberOracle)
	return ok && n.isNumber()
}
type Int struct {
	Location
	Val uint64
}
var _ ExpNode = Int{}
func NewInt(val uint64) Int {
	return Int{Val: val}
}
func (n Int) HWrite(w HWriter) {
	w.Writef("%d", n.Val)
}
func (n Int) ProcessExp(p ExpProcessor) {
	p.ProcessIntExp(n)
}
func (n Int) isNumber() bool {
	return true
}
type Float struct {
	Location
	Val float64
}
var _ ExpNode = Float{}