Skip to content

Commit

Permalink
refactor(everything): refactoring codebase at 90%
Browse files Browse the repository at this point in the history
  • Loading branch information
Ze7111 committed Oct 3, 2024
1 parent 919e14d commit 2ea0948
Show file tree
Hide file tree
Showing 84 changed files with 3,344 additions and 3,612 deletions.
218 changes: 109 additions & 109 deletions language/.hlx

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions libs/neo-panic/include/error.hh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
#include <vector>

#include "neo-types/include/hxint.hh"
#include "token/include/token.hh"
#include "token/include/token_list.hh"
#include "token/include/Token.hh"

#define LINES_TO_SHOW 5

Expand Down Expand Up @@ -78,7 +77,7 @@ struct _internal_error {


using string_vec = std::vector<string>;
using fix_pair = std::pair<token::Token, i64>;
using fix_pair = std::pair<__TOKEN_N::Token, i64>;
using fix_pair_vec = std::vector<fix_pair>;
using errors_rep = std::vector<_internal_error>;

Expand All @@ -104,7 +103,7 @@ struct Errors {


struct CodeError {
token::Token *pof; //< point of failure
__TOKEN_N::Token *pof; //< point of failure
double err_code;
bool mark_pof = true;
string_vec fix_fmt_args;
Expand Down Expand Up @@ -142,7 +141,7 @@ class Panic {
};


static inline CodeError create_old_CodeError(token::Token *pof,
static inline CodeError create_old_CodeError(__TOKEN_N::Token *pof,
const double err_code,
string_vec fix_fmt_args = {},
string_vec err_fmt_args = {},
Expand Down
8 changes: 4 additions & 4 deletions libs/neo-panic/source/error.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#include <tuple>
#include <vector>

#include "driver/include/file_system.hh"
#include "controller/include/Controller.hh"
#include "neo-panic/enums/error_codes.def"
#include "neo-pprint/include/ansi_colors.hh"
#include "neo-pprint/include/hxpprint.hh"
#include "token/include/token.hh"
#include "token/include/Token.hh"

namespace std {
static inline void lstrip(std::string &str) {
Expand Down Expand Up @@ -133,7 +133,7 @@ lines_vec get_surrounding_lines(const string &file_name, u64 line) {
u64 start_line = (line <= lines_before) ? 1 : (line - lines_before);

for (u64 i = start_line; i < start_line + LINES_TO_SHOW; ++i) {
auto line_content = file_system::get_line(file_name, i);
auto line_content = __CONTROLLER_FS_N::get_line(file_name, i);
if (line_content.has_value()) {
lines.emplace_back(false,
std::make_tuple(std::to_string(i), line_content.value(), i == line));
Expand Down Expand Up @@ -388,7 +388,7 @@ Panic::Panic(const CompilerError &err)
}

void Panic::process_full_line() {
auto full_line = file_system::get_line(final_err.file, final_err.line);
auto full_line = __CONTROLLER_FS_N::get_line(final_err.file, final_err.line);

if (!full_line.has_value()) {
// TODO: throw error
Expand Down
File renamed without changes.
Loading

0 comments on commit 2ea0948

Please sign in to comment.