lib/core: Added `is_whitespace` method to `Byte`
authorLucas Bajolet <r4pass@hotmail.com>
Wed, 8 Jun 2016 15:06:40 +0000 (11:06 -0400)
committerLucas Bajolet <r4pass@hotmail.com>
Wed, 8 Jun 2016 18:31:45 +0000 (14:31 -0400)
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

lib/core/kernel.nit

index 399487a..fe45072 100644 (file)
@@ -699,6 +699,9 @@ universal Byte
                        return self
                end
        end
+
+       # Is `self` an ASCII whitespace ?
+       fun is_whitespace: Bool do return self == 0x7Fu8 or self <= 0x20u8
 end
 
 # Native integer numbers.