func (t *Tokeniser) token(typ Type) Token {
	var literalVal interface{}
	switch typ {
	case INT:
		i, err := strconv.ParseInt(t.Input[t.start:t.pos], 0, 64)
		if err != nil {
			logi.Get().Warn("integer parse err", "err", err.Error(), "line", t.line, "col", t.col)
		} else {
			literalVal = i
		}
	case FLOAT:
		i, err := strconv.ParseFloat(t.Input[t.start:t.pos], 64)
		if err != nil {
			logi.Get().Warn("float parse err", "err", err.Error(), "line", t.line, "col", t.col)
		} else {
			literalVal = i
		}
	case STR:
		literalVal = t.Input[t.start:t.pos]
	case FALSE:
		literalVal = false
	case TRUE:
		literalVal = true
	}
	return Token{
		Type:        typ,
		Literal:     literalVal,
		StringValue: t.Input[t.start:t.pos],
		Line:        t.prevLine,
		Col:         t.prevCol,
		Offset:      t.start,
		Width:       t.pos - t.start,
	}
}
// token returns a token at the current position, given the type passed in.
token returns a token at the current position, given the type passed in.
// token returns a token at the current position given the type passed in .
func (t *Tokeniser) token(typ Type) Token {
	var literalVal interface{}
	switch typ {
	case INT:
		i, err := strconv.ParseInt(t.Input[t.start:t.pos], 0, 64)
		if err != nil {
			logi.Get().Warn("integer parse err", "err", err.Error(), "line", t.line, "col", t.col)
		} else {
			literalVal = i
		}
	case FLOAT:
		i, err := strconv.ParseFloat(t.Input[t.start:t.pos], 64)
		if err != nil {
			logi.Get().Warn("float parse err", "err", err.Error(), "line", t.line, "col", t.col)
		} else {
			literalVal = i
		}
	case STR:
		literalVal = t.Input[t.start:t.pos]
	case FALSE:
		literalVal = false
	case TRUE:
		literalVal = true
	}
	return Token{
		Type:        typ,
		Literal:     literalVal,
		StringValue: t.Input[t.start:t.pos],
		Line:        t.prevLine,
		Col:         t.prevCol,
		Offset:      t.start,
		Width:       t.pos - t.start,
	}
}
func ( t * Tokeniser ) token ( typ Type ) Token { var literalVal interface { } switch typ { case INT : i , err := strconv . ParseInt ( t . Input [ t . start : t . pos ] , 0 , 64 ) if err != nil { logi . Get ( ) . Warn ( " " , " " , err . Error ( ) , " " , t . line , " " , t . col ) } else { literalVal = i } case FLOAT : i , err := strconv . ParseFloat ( t . Input [ t . start : t . pos ] , 64 ) if err != nil { logi . Get ( ) . Warn ( " " , " " , err . Error ( ) , " " , t . line , " " , t . col ) } else { literalVal = i } case STR : literalVal = t . Input [ t . start : t . pos ] case FALSE : literalVal = false case TRUE : literalVal = true } return Token { Type : typ , Literal : literalVal , StringValue : t . Input [ t . start : t . pos ] , Line : t . prevLine , Col : t . prevCol , Offset : t . start , Width : t . pos - t . start , } }
token returns a token at the current position, given the type passed in.
token returns a token at the current position given the type passed in .