| 94 | } |
| 95 | |
| 96 | std::vector<uint8_t> do_parse( |
| 97 | parser_config const &config, std::string const &filename, |
| 98 | std::string const &s, std::string const &outfile, std::ostream &os) |
| 99 | { |
| 100 | if (config.verbose) { |
| 101 | std::cerr << "parsing " << filename << '\n'; |
| 102 | } |
| 103 | |
| 104 | auto opcodes = parse_opcodes(config, s); |
| 105 | if (config.verbose) { |
| 106 | std::cerr << "writing " << outfile << '\n'; |
| 107 | } |
| 108 | os.write( |
| 109 | reinterpret_cast<char const *>(opcodes.data()), |
| 110 | static_cast<long>(opcodes.size())); |
| 111 | return opcodes; |
| 112 | } |
| 113 | |
| 114 | void do_binary( |
| 115 | parser_config const &config, std::string const &filename, |
no test coverage detected