diff options
Diffstat (limited to 'src/parsing.cpp')
-rw-r--r-- | src/parsing.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/parsing.cpp b/src/parsing.cpp index 3cb61cb44..59c0e3324 100644 --- a/src/parsing.cpp +++ b/src/parsing.cpp @@ -211,34 +211,6 @@ bool x500_name_cmp(const std::string& name1, const std::string& name2) } /************************************************* -* Parse and compute an arithmetic expression * -*************************************************/ -u32bit parse_expr(const std::string& expr) - { - const bool have_add = (expr.find('+') != std::string::npos); - const bool have_mul = (expr.find('*') != std::string::npos); - - if(have_add) - { - std::vector<std::string> sub_expr = split_on(expr, '+'); - u32bit result = 0; - for(u32bit j = 0; j != sub_expr.size(); ++j) - result += parse_expr(sub_expr[j]); - return result; - } - else if(have_mul) - { - std::vector<std::string> sub_expr = split_on(expr, '*'); - u32bit result = 1; - for(u32bit j = 0; j != sub_expr.size(); ++j) - result *= parse_expr(sub_expr[j]); - return result; - } - else - return to_u32bit(expr); - } - -/************************************************* * Convert a decimal-dotted string to binary IP * *************************************************/ u32bit string_to_ipv4(const std::string& str) |