24 lines
535 B
C++
24 lines
535 B
C++
#include <vector>
|
|
#include <string>
|
|
#include <iostream>
|
|
using namespace std;
|
|
|
|
#include "include/colors.h"
|
|
#include "include/tokenize.h"
|
|
|
|
|
|
void pretty_print_error(vector<string> history, CodePosition pos) {
|
|
if (pos.column == -1 || pos.line == -1)
|
|
return;
|
|
|
|
cout << pos.column << ";" << pos.line << endl;
|
|
string line = history[pos.line];
|
|
|
|
printf(BOLD "%4d " RESET , pos.line+1);
|
|
cout << line << endl;
|
|
|
|
for (int i=0; i < pos.column + 5; i++)
|
|
cout << " ";
|
|
|
|
cout << BOLD RED "^--" RESET << endl;
|
|
} |