diff options
author | Ori Bernstein <ori@eigenstate.org> | 2015-10-04 10:59:36 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2015-10-04 20:35:52 -0700 |
commit | 8728342de349e7029312ddbd33c2710d2d03fff2 (patch) | |
tree | 392b0b93b70b3129f9fb790bc04cac9571eb05e5 /lib/regex | |
parent | 35bde60621ecf5cbcf07b743cafd9724f87faccb (diff) | |
download | mc-8728342de349e7029312ddbd33c2710d2d03fff2.tar.gz |
Make the interface for libbio expose errors.
Filling in all the error conditions correctly is only lightly
tested, but it seems to work.
Diffstat (limited to 'lib/regex')
-rw-r--r-- | lib/regex/redump.myr | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/regex/redump.myr b/lib/regex/redump.myr index 920b257..5c1e7bc 100644 --- a/lib/regex/redump.myr +++ b/lib/regex/redump.myr @@ -57,10 +57,13 @@ const runall = {re, files const dump = {re, fd while true match bio.readln(fd) - | `std.Some ln: + | `bio.Ok ln: show(re, ln, regex.exec(re, ln)) std.slfree(ln) - | `std.None: + | `bio.Eof: + break + | `bio.Err: + std.put("error reading from input") break ;; ;; |