func lexNumber(t *Tokeniser) stateFunc {
	// Leading 0 ==> can be hexadecimal (0x/0X), octal (0o/0O) or binary (0b/0B)
	if _, ok := t.checkSet("0"); ok {
		return lexSpecialInteger
	}
	emitTyp := INT
	// advance part before dot if it exist
	w, _ := t.checkNumber(10)
	t.advance(w)
	if w, ok := t.checkSet("."); ok {
		t.advance(w)
		emitTyp = FLOAT
		w, _ = t.checkNumber(10)
		t.advance(w)
	}
	if w, ok := t.checkSet("eE"); ok {
		t.advance(w)
		emitTyp = FLOAT
		w, _ = t.checkSet("+-")
		t.advance(w)
		if w, ok = t.checkNumber(10); ok {
			t.advance(w)
		} else {
			t.emitErrorf("illegal floating-point exponent: %q", t.Input[t.start:t.pos])
			return nil
		}
	}
	t.emit(emitTyp)
	return lexCode
}
// lexNumber scans for a number, assumes that the Tokeniser has not consumed the start
// of the number (either number or a dot)
lexNumber scans for a number, assumes that the Tokeniser has not consumed the start
of the number (either number or a dot)
// lexNumber scans for a number assumes that the Tokeniser has not consumed the start // of the number ( either number or a dot )
func lexNumber(t *Tokeniser) stateFunc {
	if _, ok := t.checkSet("0"); ok {
		return lexSpecialInteger
	}
	emitTyp := INT
	w, _ := t.checkNumber(10)
	t.advance(w)
	if w, ok := t.checkSet("."); ok {
		t.advance(w)
		emitTyp = FLOAT
		w, _ = t.checkNumber(10)
		t.advance(w)
	}
	if w, ok := t.checkSet("eE"); ok {
		t.advance(w)
		emitTyp = FLOAT
		w, _ = t.checkSet("+-")
		t.advance(w)
		if w, ok = t.checkNumber(10); ok {
			t.advance(w)
		} else {
			t.emitErrorf("illegal floating-point exponent: %q", t.Input[t.start:t.pos])
			return nil
		}
	}
	t.emit(emitTyp)
	return lexCode
}
func lexNumber ( t * Tokeniser ) stateFunc { if _ , ok := t . checkSet ( " " ) ; ok { return lexSpecialInteger } emitTyp := INT w , _ := t . checkNumber ( 10 ) t . advance ( w ) if w , ok := t . checkSet ( " " ) ; ok { t . advance ( w ) emitTyp = FLOAT w , _ = t . checkNumber ( 10 ) t . advance ( w ) } if w , ok := t . checkSet ( " " ) ; ok { t . advance ( w ) emitTyp = FLOAT w , _ = t . checkSet ( " " ) t . advance ( w ) if w , ok = t . checkNumber ( 10 ) ; ok { t . advance ( w ) } else { t . emitErrorf ( " " , t . Input [ t . start : t . pos ] ) return nil } } t . emit ( emitTyp ) return lexCode }
lexNumber scans for a number, assumes that the Tokeniser has not consumed the start
of the number (either number or a dot)
lexNumber scans for a number assumes that the Tokeniser has not consumed the start of the number ( either number or a dot )
// Leading 0 ==> can be hexadecimal (0x/0X), octal (0o/0O) or binary (0b/0B) // advance part before dot if it exist