typped.text_stream¶
The TextStream
class. Not currently used, may become an abstraction layer for
the stream of text to be parsed.
-
class
typped.text_stream.
TextStream
[source]¶ Bases:
object
This is just a unified wrapper for a stream of text characters which may come from various sources.
-
next
()[source]¶ Get the next character in the text stream. Can be used as:
while not ts.end_of_text_stream(): char = ts.next() ...
or else as:
for char in ts: ...
-
refill_char_buffer_if_empty
()[source]¶ Read a line to refill the char buffer. Return
False
if end of stream is encountered,True
otherwise.
-
peek
()[source]¶ Peeks one character ahead in the text stream. Returns empty string if peek is attempted after
end_of_text_stream()
isTrue
.
-