aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/eval.h4
-rw-r--r--include/lang_analysis/lexer_class.h18
-rw-r--r--include/lang_analysis/symbol_property.h6
-rw-r--r--include/lang_analysis/token.h4
4 files changed, 13 insertions, 19 deletions
diff --git a/include/eval.h b/include/eval.h
index 360de66..1db31af 100644
--- a/include/eval.h
+++ b/include/eval.h
@@ -5,8 +5,8 @@
namespace ov4
{
-int eval_exe(const string &s, bool is_async);
-int eval_exe(const string &s, bool is_async, const T_lexer *lexer_instance, size_t i);
+int eval_exe(const std::string &s, bool is_async);
+int eval_exe(const std::string &s, bool is_async, const T_lexer *lexer_instance, size_t i);
int eval_tree_cd(size_t i, const T_lexer &lexer_instance, bool inside_subshell);
void eval(char *cmdline);
diff --git a/include/lang_analysis/lexer_class.h b/include/lang_analysis/lexer_class.h
index 4100b97..f642e57 100644
--- a/include/lang_analysis/lexer_class.h
+++ b/include/lang_analysis/lexer_class.h
@@ -6,8 +6,6 @@
#include "lang_analysis/enum_type.h"
-using namespace std;
-
namespace ov4
{
@@ -17,25 +15,25 @@ public:
// token.h
class T_token;
- string trim(const string &s, const string &trim_target = " \t");
+ std::string trim(const std::string &s, const std::string &trim_target = " \t");
bool is_single_symbol(char c);
void bracket_depth_changer(char c, int &bracket_depth);
- bool token_continue(const string &s, char next);
- void token_push(const string &push_s, int bracket_depth, bool force_text = false);
- int tokenizer(const string &s);
+ bool token_continue(const std::string &s, char next);
+ void token_push(const std::string &push_s, int bracket_depth, bool force_text = false);
+ int tokenizer(const std::string &s);
// ast.h
class T_ast;
- string final_trim(size_t _begin, size_t _end);
- size_t alloc_ast();
+ std::string final_trim(std::size_t _begin, std::size_t _end);
+ std::size_t alloc_ast();
int get_pivot_order(enum_token_type x);
bool is_operator(enum_token_type x);
- void parse(size_t cmd_begin, size_t cmd_end, size_t ast_vec);
+ void parse(std::size_t cmd_begin, std::size_t cmd_end, std::size_t ast_vec);
// shared
std::vector<T_ast> ast;
std::vector<T_token> token;
- size_t ast_index = 0;
+ std::size_t ast_index = 0;
};
diff --git a/include/lang_analysis/symbol_property.h b/include/lang_analysis/symbol_property.h
index f21b145..d0acc7a 100644
--- a/include/lang_analysis/symbol_property.h
+++ b/include/lang_analysis/symbol_property.h
@@ -5,8 +5,6 @@
#include "lang_analysis/enum_type.h"
-using namespace std;
-
namespace ov4
{
@@ -27,7 +25,7 @@ public:
enum_token_type enum_type = TEXT;
};
-inline const unordered_map<string, T_property> symbol_property = {
+inline const std::unordered_map<std::string, T_property> symbol_property = {
// bracket
{"(", {.continuable = false, .enum_type = LEFT_BRACKET}},
@@ -41,7 +39,7 @@ inline const unordered_map<string, T_property> symbol_property = {
};
-string symbol_enum2string(enum_token_type e);
+std::string symbol_enum2string(enum_token_type e);
bool symbol_contains_enum_type(enum_token_type e);
diff --git a/include/lang_analysis/token.h b/include/lang_analysis/token.h
index 508d142..45d06f3 100644
--- a/include/lang_analysis/token.h
+++ b/include/lang_analysis/token.h
@@ -6,8 +6,6 @@
#include "lang_analysis/enum_type.h"
#include "lang_analysis/symbol_property.h"
-using namespace std; // remove this
-
namespace ov4
{
@@ -17,7 +15,7 @@ public:
T_token() = default;
enum_token_type token_type;
- string text;
+ std::string text;
guard_type guard = GUARD_OFF;
int bracket_depth = 0;
};