On Thu, May 29, 2014 at 2:32 PM, Oleg Eterevsky <o...@eterevsky.com> wrote: > What would be Rust alternative, except passing the errors all around > parser? Doesn't it grow parser code by at least 50%?
With things like try! and the various helper methods on Result/Option, passing errors around is supposed to be easier than in other languages. I haven't done much with it, so I don't know how well it works. You can also spawn a task for the parser, since the internal parser data structures don't need to be kept around after failure or anything; as mentioned in a previous post, a better way to do this synchronously on the same thread might be added. Of course, depending on what you're parsing, you may want to continue after errors to report further problems, in which case the exception version wouldn't work anyway. _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev