2023-10-27 14:09:25 +02:00
|
|
|
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#include "include/config.h"
|
2023-11-11 09:05:57 +01:00
|
|
|
#include "include/colors.h"
|
2023-10-27 14:09:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string get_input() {
|
|
|
|
string buffer;
|
|
|
|
string input = "";
|
|
|
|
|
|
|
|
int line_num = 0;
|
|
|
|
while (1) {
|
|
|
|
line_num++;
|
2023-11-11 09:05:57 +01:00
|
|
|
printf(BOLD "%4d " RESET , line_num);
|
|
|
|
if (!getline(cin, buffer)) {
|
|
|
|
cout << "\rReceived EOF" << endl;
|
|
|
|
exit(0);
|
|
|
|
}
|
2023-10-27 14:09:25 +02:00
|
|
|
input += "\n" + buffer;
|
|
|
|
|
|
|
|
int n = input.length();
|
|
|
|
if (n >= 2 && input[n-1] == ';' && input[n-2] == ';') {
|
|
|
|
input[n-1] = '\0';
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return input;
|
|
|
|
}
|