Is self a valid integer ?

assert "0xFE46u8".is_num
assert "0b0100".is_num
assert "0o645".is_num
assert "897u8".is_num

Property definitions

core :: fixed_ints_text $ Text :: is_num
	# Is `self` a valid integer ?
	#
	#     assert "0xFE46u8".is_num
	#     assert "0b0100".is_num
	#     assert "0o645".is_num
	#     assert "897u8".is_num
	fun is_num: Bool do
		var prefix = get_numhead
		var s = strip_numhead.strip_numext.remove_all('_')
		if prefix != "" then
			var c = prefix[1]
			if c == 'x' or c == 'X' then return s.is_hex
			if c == 'o' or c == 'O' then return s.is_oct
			if c == 'b' or c == 'B' then return s.is_bin
		end
		return s.is_dec
	end
lib/core/text/fixed_ints_text.nit:271,2--287,4