[flang] Refactor ModFileReader to use parser::Parsing
parser::Parsing does most of the work needed to prescan and parse a file.
The only problem is that for module files we need to take ownership of
the cooked character stream so that it lives as long as the module scope
does.
To achieve this, change Parsing::cooked_ to be a unique_ptr and add a
member function to allow the caller to take ownership of it.
Original-commit: flang-compiler/f18@
9088891ab29d91a51c55edb031b5a974cc8254b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/149
Tree-same-pre-rewrite: false