Merge remote-tracking branch 'refs/remotes/origin/main'
This commit is contained in:
commit
937f568f76
@ -14,4 +14,9 @@ CodePosition get_node_pos(Node node);
|
||||
*/
|
||||
Type string_to_type(string type_name);
|
||||
|
||||
/**
|
||||
* Splits a string using the provided delimiter
|
||||
*/
|
||||
vector<string> split_string(const string& input, char delimiter);
|
||||
|
||||
#endif
|
@ -1,3 +1,8 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
#include "include/utils.h"
|
||||
|
||||
CodePosition get_node_pos(Node node) {
|
||||
@ -13,4 +18,16 @@ Type string_to_type(string type_name) {
|
||||
return Type::Double;
|
||||
|
||||
throw exception();
|
||||
}
|
||||
|
||||
vector<string> split_string(const string& input, char delimiter) {
|
||||
vector<string> tokens;
|
||||
string token;
|
||||
istringstream tokenStream(input);
|
||||
|
||||
while (getline(tokenStream, token, delimiter)) {
|
||||
tokens.push_back(token);
|
||||
}
|
||||
|
||||
return tokens;
|
||||
}
|
Loading…
Reference in New Issue
Block a user