Rename headers to .hpp
This commit is contained in:
parent
5d0f86545e
commit
553c820a8a
4
Makefile
4
Makefile
@ -14,7 +14,7 @@ TESTS_OBJ = $(TESTS_SRC:$(TEST_SRCDIR)/%.cpp=$(BUILDDIR)/test-%)
|
||||
LD_CXXFLAGS =
|
||||
|
||||
# Compilation flag
|
||||
CXXFLAGS = -Wall -Wextra -g -O0 -std=c++2a
|
||||
CXXFLAGS = -Wall -Wextra -g -O3 -std=c++2a
|
||||
# Remove warnings about unused variables, functions, ...
|
||||
# -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable
|
||||
# Compile with debug
|
||||
@ -26,7 +26,7 @@ $(BUILDDIR)/main: $(SRCDIR)/main.cpp $(OBJ)
|
||||
$(CXX) $^ -o $@ $(CXXFLAGS) $(LD_CXXFLAGS)
|
||||
|
||||
|
||||
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp $(SRCDIR)/include/%.h
|
||||
$(BUILDDIR)/%.o: $(SRCDIR)/%.cpp $(SRCDIR)/include/%.hpp
|
||||
$(CXX) -c $< -o $@ $(CXXFLAGS)
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <iostream>
|
||||
#include "include/utils.h"
|
||||
#include "include/errors.h"
|
||||
#include "include/analysis.h"
|
||||
#include "include/utils.hpp"
|
||||
#include "include/errors.hpp"
|
||||
#include "include/analysis.hpp"
|
||||
|
||||
bool bool_castable(AnalysisResult type) {
|
||||
(void)type;
|
||||
|
@ -4,10 +4,10 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "include/utils.h"
|
||||
#include "include/errors.h"
|
||||
#include "include/colors.h"
|
||||
#include "include/tokenize.h"
|
||||
#include "include/utils.hpp"
|
||||
#include "include/errors.hpp"
|
||||
#include "include/colors.hpp"
|
||||
#include "include/tokenize.hpp"
|
||||
|
||||
string UserError::get_message(void) const {
|
||||
switch (this->type) {
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "include/execute.h"
|
||||
#include "include/execute.hpp"
|
||||
|
||||
|
||||
EvalResult execute(vector<string> input, Memory& memory, int initial_line, ExecArgs args) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef ANALYSIS_H
|
||||
#define ANALYSIS_H
|
||||
|
||||
#include "types.h"
|
||||
#include "memory.h"
|
||||
#include "types.hpp"
|
||||
#include "memory.hpp"
|
||||
using namespace std;
|
||||
|
||||
using AnalysisResult = variant<Type, monostate>;
|
@ -4,7 +4,7 @@
|
||||
#include <string>
|
||||
using namespace std;
|
||||
|
||||
#include "tokenize.h"
|
||||
#include "tokenize.hpp"
|
||||
|
||||
/**
|
||||
* Errors
|
@ -1,13 +1,13 @@
|
||||
#ifndef DEF_EXECUTE_H
|
||||
#define DEF_EXECUTE_H
|
||||
|
||||
#include "errors.h"
|
||||
#include "parser.h"
|
||||
#include "colors.h"
|
||||
#include "memory.h"
|
||||
#include "tokenize.h"
|
||||
#include "analysis.h"
|
||||
#include "interpreter.h"
|
||||
#include "errors.hpp"
|
||||
#include "parser.hpp"
|
||||
#include "colors.hpp"
|
||||
#include "memory.hpp"
|
||||
#include "tokenize.hpp"
|
||||
#include "analysis.hpp"
|
||||
#include "interpreter.hpp"
|
||||
|
||||
typedef struct ExecArgs {
|
||||
bool print_tokens=false;
|
@ -3,9 +3,9 @@
|
||||
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include "types.h"
|
||||
#include "memory.h"
|
||||
#include "errors.h"
|
||||
#include "types.hpp"
|
||||
#include "memory.hpp"
|
||||
#include "errors.hpp"
|
||||
using namespace std;
|
||||
|
||||
/*
|
@ -5,8 +5,8 @@
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <optional>
|
||||
#include "types.h"
|
||||
#include "colors.h"
|
||||
#include "types.hpp"
|
||||
#include "colors.hpp"
|
||||
using namespace std;
|
||||
|
||||
class Memory {
|
@ -5,8 +5,8 @@
|
||||
#include <variant>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include "tokenize.h"
|
||||
#include "errors.h"
|
||||
#include "tokenize.hpp"
|
||||
#include "errors.hpp"
|
||||
using namespace std;
|
||||
|
||||
/**
|
@ -4,7 +4,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <stdexcept>
|
||||
#include "types.h"
|
||||
#include "types.hpp"
|
||||
using namespace std;
|
||||
|
||||
/*
|
@ -1,7 +1,7 @@
|
||||
#ifndef DEF_UTILS_H
|
||||
#define DEF_UTILS_H
|
||||
|
||||
#include "types.h"
|
||||
#include "types.hpp"
|
||||
using namespace std;
|
||||
|
||||
/**
|
@ -6,8 +6,8 @@
|
||||
#include <termios.h> // for tc(get/set)attr
|
||||
using namespace std;
|
||||
|
||||
#include "include/config.h"
|
||||
#include "include/colors.h"
|
||||
#include "include/config.hpp"
|
||||
#include "include/colors.hpp"
|
||||
|
||||
|
||||
char silent_get_char() { // Get char without echoing it
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include "include/parser.h"
|
||||
#include "include/interpreter.h"
|
||||
#include "include/memory.h"
|
||||
#include "include/utils.h"
|
||||
#include "include/parser.hpp"
|
||||
#include "include/interpreter.hpp"
|
||||
#include "include/memory.hpp"
|
||||
#include "include/utils.hpp"
|
||||
using namespace std;
|
||||
|
||||
bool bool_cast(EvalResult value) {
|
||||
|
10
src/main.cpp
10
src/main.cpp
@ -2,11 +2,11 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
#include "include/input.h"
|
||||
#include "include/errors.h"
|
||||
#include "include/colors.h"
|
||||
#include "include/execute.h"
|
||||
#include "include/memory.h"
|
||||
#include "include/input.hpp"
|
||||
#include "include/errors.hpp"
|
||||
#include "include/colors.hpp"
|
||||
#include "include/execute.hpp"
|
||||
#include "include/memory.hpp"
|
||||
|
||||
void show_help(char* prog_name) {
|
||||
printf("Usage: %s [OPTIONS]\n\n", prog_name);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "include/memory.h"
|
||||
#include "include/errors.h"
|
||||
#include "include/utils.h"
|
||||
#include "include/types.h"
|
||||
#include "include/memory.hpp"
|
||||
#include "include/errors.hpp"
|
||||
#include "include/utils.hpp"
|
||||
#include "include/types.hpp"
|
||||
using namespace std;
|
||||
|
||||
Memory::Memory(void) {
|
||||
|
@ -3,11 +3,11 @@
|
||||
#include <algorithm>
|
||||
using namespace std;
|
||||
|
||||
#include "include/tokenize.h"
|
||||
#include "include/colors.h"
|
||||
#include "include/parser.h"
|
||||
#include "include/config.h"
|
||||
#include "include/utils.h"
|
||||
#include "include/tokenize.hpp"
|
||||
#include "include/colors.hpp"
|
||||
#include "include/parser.hpp"
|
||||
#include "include/config.hpp"
|
||||
#include "include/utils.hpp"
|
||||
|
||||
CodePosition null_pos = {
|
||||
.line = -1,
|
||||
|
@ -2,8 +2,8 @@
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "include/errors.h"
|
||||
#include "include/tokenize.h"
|
||||
#include "include/errors.hpp"
|
||||
#include "include/tokenize.hpp"
|
||||
using namespace std;
|
||||
|
||||
regex INT_REGEX ("\\d+");
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
#include "include/utils.h"
|
||||
#include "include/utils.hpp"
|
||||
|
||||
CodePosition get_node_pos(Node node) {
|
||||
if (holds_alternative<InnerNode>(node))
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "include/test.h"
|
||||
#include "include/test.hpp"
|
||||
|
||||
#include "../src/include/execute.h"
|
||||
#include "../src/include/utils.h"
|
||||
#include "../src/include/execute.hpp"
|
||||
#include "../src/include/utils.hpp"
|
||||
|
||||
int execute(string s) {
|
||||
Memory memory;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "include/test.h"
|
||||
#include "include/test.hpp"
|
||||
|
||||
#include "../src/include/execute.h"
|
||||
#include "../src/include/utils.h"
|
||||
#include "../src/include/execute.hpp"
|
||||
#include "../src/include/utils.hpp"
|
||||
|
||||
int execute(string s) {
|
||||
Memory memory;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "include/test.h"
|
||||
#include "include/test.hpp"
|
||||
|
||||
#include "../src/include/execute.h"
|
||||
#include "../src/include/utils.h"
|
||||
#include "../src/include/execute.hpp"
|
||||
#include "../src/include/utils.hpp"
|
||||
|
||||
EvalResult execute(string s) {
|
||||
Memory memory;
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef DEF_TEST_H
|
||||
#define DEF_TEST_H
|
||||
|
||||
#include "../../src/include/colors.h"
|
||||
#include "../../src/include/errors.h"
|
||||
#include "../../src/include/colors.hpp"
|
||||
#include "../../src/include/errors.hpp"
|
||||
|
||||
#define _TEST_PRESENTATION(description) { printf("\n" BLUE "#### %s:" BOLD "%s" RESET BLUE " #####" RESET "\n", __FILE__, description); }
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "include/test.h"
|
||||
#include "include/test.hpp"
|
||||
|
||||
#include "../src/include/execute.h"
|
||||
#include "../src/include/utils.h"
|
||||
#include "../src/include/execute.hpp"
|
||||
#include "../src/include/utils.hpp"
|
||||
|
||||
int execute(string s) {
|
||||
Memory memory;
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "include/test.h"
|
||||
#include "include/test.hpp"
|
||||
|
||||
#include "../src/include/execute.h"
|
||||
#include "../src/include/utils.h"
|
||||
#include "../src/include/execute.hpp"
|
||||
#include "../src/include/utils.hpp"
|
||||
|
||||
EvalResult execute(string s, Memory& memory) {
|
||||
return execute(split_string(s, '\n'), memory);
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "include/test.h"
|
||||
#include "include/test.hpp"
|
||||
|
||||
#include "../src/include/execute.h"
|
||||
#include "../src/include/utils.h"
|
||||
#include "../src/include/execute.hpp"
|
||||
#include "../src/include/utils.hpp"
|
||||
|
||||
EvalResult execute(string s) {
|
||||
Memory memory;
|
||||
|
@ -2,9 +2,9 @@
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#include "include/test.h"
|
||||
#include "include/test.hpp"
|
||||
|
||||
#include "../src/include/tokenize.h"
|
||||
#include "../src/include/tokenize.hpp"
|
||||
|
||||
int main() {
|
||||
_TEST_PRESENTATION("Lexer");
|
||||
|
@ -1,7 +1,7 @@
|
||||
#include "include/test.h"
|
||||
#include "include/test.hpp"
|
||||
|
||||
#include "../src/include/execute.h"
|
||||
#include "../src/include/utils.h"
|
||||
#include "../src/include/execute.hpp"
|
||||
#include "../src/include/utils.hpp"
|
||||
|
||||
EvalResult execute(string s) {
|
||||
Memory memory;
|
||||
|
Loading…
Reference in New Issue
Block a user