lib: fix nullable in filter_stream
authorJean-Sebastien Gelinas <calestar@gmail.com>
Sat, 27 Jun 2009 01:35:09 +0000 (21:35 -0400)
committerJean Privat <jean@pryen.org>
Sat, 4 Jul 2009 00:56:00 +0000 (20:56 -0400)
Signed-off-by: Jean-Sebastien Gelinas <calestar@gmail.com>
Signed-off-by: Jean Privat <jean@pryen.org>

lib/filter_stream.nit

index bcd01be..999f12c 100644 (file)
@@ -1,6 +1,7 @@
 # This file is part of NIT ( http://www.nitlanguage.org ).
 #
 # Copyright 2006 Floréal Morandat <morandat@lirmm.fr>
+# Copyright 2009 Jean-Sebastien Gelinas <calestar@gmail.com>
 #
 # This file is free software, which comes along with NIT.  This software is
 # distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
@@ -13,7 +14,7 @@
 class FilterIStream
 special IStream
        # Filter readed elements
-       readable var _stream: IStream 
+       readable var _stream: nullable IStream
 
        redef fun eof: Bool
        do
@@ -21,7 +22,7 @@ special IStream
                return stream.eof
        end
 
-       private fun stream=(i: IStream)
+       private fun stream=(i: nullable IStream)
        do
                _stream = i
        end
@@ -30,7 +31,7 @@ end
 class FilterOStream
 special OStream
        # Filter outputed elements
-       readable var _stream: OStream 
+       readable var _stream: nullable OStream
 
        # Can the stream be used to write
        redef fun is_writable: Bool
@@ -62,7 +63,7 @@ special FilterIStream
                end
        end
 
-       redef fun stream: IStream
+       redef fun stream: nullable IStream
        do
                if _stream == null and _streams.is_ok then
                        stream = _streams.item