From the 101 lk/man/pth code-gen sources: 63 tasks (C11 36, C++17 27, 11 canonical families), 38 skipped for scope or duplication. Each task has at least one independent contract-edge defect, boundary types rotate, and public docs state trap clauses as plain contract prose. Claude reviewed 63/63 USABLE against current digests. Difficulty is unmeasured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
956 B
C++
30 lines
956 B
C++
#include "frames.hpp"
|
|
#include <iostream>
|
|
#include <cstdio>
|
|
#include <string>
|
|
int main() {
|
|
frames::Bank bank;
|
|
std::string line;
|
|
bool excess=false;
|
|
char byte;
|
|
while (std::cin.get(byte)) {
|
|
if (byte!='\n') {
|
|
if (line.size()<8194) line.push_back(byte);
|
|
else excess=true;
|
|
continue;
|
|
}
|
|
if (!line.empty() && line.back()=='\r') line.pop_back();
|
|
if (excess || line.size()>8192) std::cout << "{\"rc\":-1,\"out\":[]}" << '\n';
|
|
else std::cout << frames::execute(&bank,line.data(),line.size()) << '\n';
|
|
line.clear();
|
|
excess=false;
|
|
}
|
|
if (std::cin.bad() || std::ferror(stdin)) return 2;
|
|
if (!line.empty() || excess) {
|
|
if (excess || line.size()>8192) std::cout << "{\"rc\":-1,\"out\":[]}" << '\n';
|
|
else std::cout << frames::execute(&bank,line.data(),line.size()) << '\n';
|
|
}
|
|
std::cout.flush();
|
|
return std::cout ? 0 : 2;
|
|
}
|