2023-11-15 13:48:40 +01:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
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
|
|
|
|
|
|
|
|
|
|
|
|
2023-11-15 13:48:40 +01:00
|
|
|
vector<string> get_input() {
|
2023-10-27 14:09:25 +02:00
|
|
|
string buffer;
|
2023-11-15 13:48:40 +01:00
|
|
|
vector<string> input;
|
2023-10-27 14:09:25 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
2023-11-15 13:48:40 +01:00
|
|
|
int n = buffer.length();
|
|
|
|
if (n >= 2 && buffer[n-1] == ';' && buffer[n-2] == ';') {
|
2023-11-15 14:57:32 +01:00
|
|
|
input.push_back(buffer);
|
2023-11-15 13:48:40 +01:00
|
|
|
buffer[n-1] = '\0';
|
2023-10-27 14:09:25 +02:00
|
|
|
break;
|
|
|
|
}
|
2023-11-15 13:48:40 +01:00
|
|
|
|
|
|
|
input.push_back(buffer);
|
2023-10-27 14:09:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return input;
|
|
|
|
}
|