func lexSpecialInteger(t *Tokeniser) stateFunc {
	_, w := t.currentRune()
	t.advance(w)
	if w, ok := t.checkSet("xX"); ok { // hex
		t.advance(w)
		w, ok = t.checkNumber(16)
		if !ok {
			// Only scanned "0x" or "0X"
			t.emitErrorf("illegal hexadecimal number: %q", t.Input[t.start:t.pos])
			return nil
		}
		t.advance(w)
	} else if w, ok = t.checkSet("oO"); ok { // octal
		t.advance(w)
		w, ok = t.checkNumber(8)
		if !ok {
			// Only scanned "0o" or "0O"
			t.emitErrorf("illegal octal number: %q", t.Input[t.start:t.pos])
			return nil
		}
		t.advance(w)
		w, ok = t.checkNumber(10)
		if ok {
			// error, illegal octal int/float
			t.advance(w)
			t.emitErrorf("illegal octal number: %q", t.Input[t.start:t.pos])
			return nil
		}
	} else if w, ok = t.checkSet("bB"); ok { // binary
		t.advance(w)
		w, ok = t.checkNumber(2)
		if !ok {
			// Only scanned "0b" or "0B"
			t.emitErrorf("illegal binary number: %q", t.Input[t.start:t.pos])
			return nil
		}
		w, ok := t.checkNumber(10)
		if ok {
			// error, illegal binary int
			t.advance(w)
			t.emitErrorf("illegal binary number: %q", t.Input[t.start:t.pos])
			return nil
		}
	} else { // to octal without "o"
		w, octalOk := t.checkNumber(8)
		if octalOk {
			// Found octal digits
			t.advance(w)
		}
		w, decimalOk := t.checkNumber(10)
		if decimalOk {
			// error, illegal octal int/float
			t.advance(w)
			t.emitErrorf("illegal octal number: %q", t.Input[t.start:t.pos])
			return nil
		}
		// If no octal and decimal digits found, then that means that
		// the number is just a zero, pass through and emit.
	}
	t.emit(INT)
	return lexCode
}
// lexSpecialInteger handles the case for octal, hex and binary integers
// this assumes that the leading 0 hasnt been consumed
// NOTE: lohvht@21Mar2021: For now, for the sake of simplicity, we dont allow
// 					   for hex/octal/binary floating points yet
lexSpecialInteger handles the case for octal, hex and binary integers
this assumes that the leading 0 hasnt been consumed
NOTE: lohvht@21Mar2021: For now, for the sake of simplicity, we dont allow
for hex/octal/binary floating points yet
// lexSpecialInteger handles the case for octal hex and binary integers // this assumes that the leading 0 hasnt been consumed // NOTE : lohvht@21Mar2021 : For now for the sake of simplicity we dont allow // for hex / octal / binary floating points yet
func lexSpecialInteger(t *Tokeniser) stateFunc {
	_, w := t.currentRune()
	t.advance(w)
	if w, ok := t.checkSet("xX"); ok { 
		t.advance(w)
		w, ok = t.checkNumber(16)
		if !ok {
			t.emitErrorf("illegal hexadecimal number: %q", t.Input[t.start:t.pos])
			return nil
		}
		t.advance(w)
	} else if w, ok = t.checkSet("oO"); ok { 
		t.advance(w)
		w, ok = t.checkNumber(8)
		if !ok {
			t.emitErrorf("illegal octal number: %q", t.Input[t.start:t.pos])
			return nil
		}
		t.advance(w)
		w, ok = t.checkNumber(10)
		if ok {
			t.advance(w)
			t.emitErrorf("illegal octal number: %q", t.Input[t.start:t.pos])
			return nil
		}
	} else if w, ok = t.checkSet("bB"); ok { 
		t.advance(w)
		w, ok = t.checkNumber(2)
		if !ok {
			t.emitErrorf("illegal binary number: %q", t.Input[t.start:t.pos])
			return nil
		}
		w, ok := t.checkNumber(10)
		if ok {
			t.advance(w)
			t.emitErrorf("illegal binary number: %q", t.Input[t.start:t.pos])
			return nil
		}
	} else { 
		w, octalOk := t.checkNumber(8)
		if octalOk {
			t.advance(w)
		}
		w, decimalOk := t.checkNumber(10)
		if decimalOk {
			t.advance(w)
			t.emitErrorf("illegal octal number: %q", t.Input[t.start:t.pos])
			return nil
		}
	}
	t.emit(INT)
	return lexCode
}
func lexSpecialInteger ( t * Tokeniser ) stateFunc { _ , w := t . currentRune ( ) t . advance ( w ) if w , ok := t . checkSet ( " " ) ; ok { t . advance ( w ) w , ok = t . checkNumber ( 16 ) if ! ok { t . emitErrorf ( " " , t . Input [ t . start : t . pos ] ) return nil } t . advance ( w ) } else if w , ok = t . checkSet ( " " ) ; ok { t . advance ( w ) w , ok = t . checkNumber ( 8 ) if ! ok { t . emitErrorf ( " " , t . Input [ t . start : t . pos ] ) return nil } t . advance ( w ) w , ok = t . checkNumber ( 10 ) if ok { t . advance ( w ) t . emitErrorf ( " " , t . Input [ t . start : t . pos ] ) return nil } } else if w , ok = t . checkSet ( " " ) ; ok { t . advance ( w ) w , ok = t . checkNumber ( 2 ) if ! ok { t . emitErrorf ( " " , t . Input [ t . start : t . pos ] ) return nil } w , ok := t . checkNumber ( 10 ) if ok { t . advance ( w ) t . emitErrorf ( " " , t . Input [ t . start : t . pos ] ) return nil } } else { w , octalOk := t . checkNumber ( 8 ) if octalOk { t . advance ( w ) } w , decimalOk := t . checkNumber ( 10 ) if decimalOk { t . advance ( w ) t . emitErrorf ( " " , t . Input [ t . start : t . pos ] ) return nil } } t . emit ( INT ) return lexCode }
lexSpecialInteger handles the case for octal, hex and binary integers
this assumes that the leading 0 hasnt been consumed
NOTE: lohvht@21Mar2021: For now, for the sake of simplicity, we dont allow
for hex/octal/binary floating points yet
lexSpecialInteger handles the case for octal hex and binary integers this assumes that the leading 0 hasnt been consumed NOTE : lohvht@21Mar2021 : For now for the sake of simplicity we dont allow for hex / octal / binary floating points yet
// hex // Only scanned "0x" or "0X" // octal // Only scanned "0o" or "0O" // error, illegal octal int/float // binary // Only scanned "0b" or "0B" // error, illegal binary int // to octal without "o" // Found octal digits // error, illegal octal int/float // If no octal and decimal digits found, then that means that // the number is just a zero, pass through and emit.