diff options
| author | _ov4 <ov4@ov4.org> | 2026-09-21 04:50:06 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-09-21 04:50:06 +0000 |
| commit | 1c630655b2beb0f4b84fb7e1bc034ba62520be37 (patch) | |
| tree | e90e70c425813df29c8bbd5c1e84ef22f4e4a176 /src/lexer/parseline.cc | |
| parent | 9f5936bf64deb625a27259d778937e281ca19cea (diff) | |
fix name typo, and remove outdated parse
Diffstat (limited to 'src/lexer/parseline.cc')
| -rw-r--r-- | src/lexer/parseline.cc | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/src/lexer/parseline.cc b/src/lexer/parseline.cc deleted file mode 100644 index 064f876..0000000 --- a/src/lexer/parseline.cc +++ /dev/null @@ -1,80 +0,0 @@ -#include "lexer/parseline.h" - -#include <vector> - -#include "lexer/enum_type.h" -#include "util/string.h" - -using namespace std; - -namespace ov4 -{ - -char **parseline(const std::string &s) -{ - guard_type guard = GUARD_OFF; - vector<string> v; - size_t len = s.size(); - string prev_str = ""; - char c; - - for (size_t i = 0; i < len; i++) - { - - c = s[i]; - if (c == ' ' && guard == GUARD_OFF) continue; - - if (c == '\'' || c == '\"') - { - - // turn on GUARD - if (guard == GUARD_OFF) - { - guard = (c == '\'') ? GUARD_STRONG : GUARD_WEAK; - if (i+1 == len) - { - v.push_back(prev_str); - prev_str = ""; - } - continue; - } - // turn off - else if (guard == GUARD_STRONG && c == '\'') - { - guard = GUARD_OFF; - if (i+1 == len) - { - v.push_back(prev_str); - prev_str = ""; - } - continue; - } - // turn off - else if (guard == GUARD_WEAK && c == '\"') - { - guard = GUARD_OFF; - if (i+1 == len) - { - v.push_back(prev_str); - prev_str = ""; - } - continue; - } - // if this (single/double) quotation mark is guarded - // it should be saved - } - - prev_str += c; - - if ((i+1 >= len) || (s[i+1] == ' ' && guard == GUARD_OFF)) - { - v.push_back(prev_str); - prev_str = ""; - continue; - } - } - - return string2argv_alloc(v); -} - -} |
