Skip to content

Commit

Permalink
Almost there...
Browse files Browse the repository at this point in the history
  • Loading branch information
rocky committed Aug 22, 2021
1 parent 4434cc5 commit 0cfec45
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions mathics/builtin/files_io/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -2176,6 +2176,7 @@ class ReadList(Read):
= {123, abc}
"""

# """
rules = {
"ReadList[stream_]": "ReadList[stream, Expression]",
}
Expand All @@ -2202,10 +2203,28 @@ def apply(self, channel, types, evaluation, options):
# token_words = py_options['TokenWords']
# word_separators = py_options['WordSeparators']

name, n, stream = read_name_and_stream_from_channel(channel, evaluation)
if name is None:
return

types_list = read_list_from_types(types)

# FIXME: reinstate this code
# for typ in types_list.leaves:
# if typ not in READ_TYPES:
# evaluation.message("Read", "readf", typ)
# return SymbolFailed

record_separators, word_separators = read_get_separators(options)
py_name = name.to_python()

result = []
while True:
# FIXME: use this code instead of "super()"
# tmp = read_from_stream(stream, types_list, record_separators, word_separators, evaluation)
tmp = super(ReadList, self).apply(channel, types, evaluation, options)

# FIXME: Figure out what to do here...
if tmp is None:
return

Expand Down

0 comments on commit 0cfec45

Please sign in to comment.