Split functions into many files, remove string from std.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
extern "C" {
|
||||
#include "libabacus.h"
|
||||
}
|
||||
|
||||
#define FUNCTION(name) libab_result function_##name( \
|
||||
libab* ab, libab_ref* scope, libab_ref_vec* params, libab_ref* into)
|
||||
|
||||
|
||||
@@ -1,44 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include "ref.hpp"
|
||||
#include "util.hpp"
|
||||
#include "function_utils.hpp"
|
||||
extern "C" {
|
||||
#include "libabacus.h"
|
||||
}
|
||||
|
||||
FUNCTION(print_string);
|
||||
FUNCTION(to_string_num);
|
||||
FUNCTION(to_string_bool);
|
||||
FUNCTION(to_string_unit);
|
||||
|
||||
FUNCTION(plus);
|
||||
FUNCTION(minus);
|
||||
FUNCTION(times);
|
||||
FUNCTION(divide);
|
||||
FUNCTION(pow);
|
||||
|
||||
FUNCTION(lt);
|
||||
FUNCTION(lte);
|
||||
FUNCTION(equals);
|
||||
FUNCTION(gt);
|
||||
FUNCTION(gte);
|
||||
|
||||
FUNCTION(negate);
|
||||
FUNCTION(factorial);
|
||||
|
||||
FUNCTION(ln);
|
||||
FUNCTION(exp);
|
||||
|
||||
FUNCTION(sqrt);
|
||||
|
||||
FUNCTION(sin);
|
||||
FUNCTION(cos);
|
||||
FUNCTION(tan);
|
||||
|
||||
FUNCTION(arcsin);
|
||||
FUNCTION(arccos);
|
||||
FUNCTION(arctan);
|
||||
|
||||
FUNCTION(quit);
|
||||
FUNCTION(request_precision);
|
||||
#include "operator_functions.hpp"
|
||||
#include "other_functions.hpp"
|
||||
#include "trig_functions.hpp"
|
||||
|
||||
18
include/operator_functions.hpp
Normal file
18
include/operator_functions.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "function_utils.hpp"
|
||||
|
||||
FUNCTION(plus);
|
||||
FUNCTION(minus);
|
||||
FUNCTION(times);
|
||||
FUNCTION(divide);
|
||||
FUNCTION(pow);
|
||||
|
||||
FUNCTION(lt);
|
||||
FUNCTION(lte);
|
||||
FUNCTION(equals);
|
||||
FUNCTION(gt);
|
||||
FUNCTION(gte);
|
||||
|
||||
FUNCTION(negate);
|
||||
FUNCTION(factorial);
|
||||
8
include/other_functions.hpp
Normal file
8
include/other_functions.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "function_utils.hpp"
|
||||
|
||||
FUNCTION(ln);
|
||||
FUNCTION(exp);
|
||||
|
||||
FUNCTION(sqrt);
|
||||
6
include/repl_functions.hpp
Normal file
6
include/repl_functions.hpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "function_utils.hpp"
|
||||
|
||||
FUNCTION(quit);
|
||||
FUNCTION(request_precision);
|
||||
8
include/string_functions.hpp
Normal file
8
include/string_functions.hpp
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "function_utils.hpp"
|
||||
|
||||
FUNCTION(print_string);
|
||||
FUNCTION(to_string_num);
|
||||
FUNCTION(to_string_bool);
|
||||
FUNCTION(to_string_unit);
|
||||
12
include/trig_functions.hpp
Normal file
12
include/trig_functions.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "function_utils.hpp"
|
||||
|
||||
FUNCTION(sin);
|
||||
FUNCTION(cos);
|
||||
FUNCTION(tan);
|
||||
|
||||
FUNCTION(arcsin);
|
||||
FUNCTION(arccos);
|
||||
FUNCTION(arctan);
|
||||
|
||||
Reference in New Issue
Block a user