mirror of
https://gitee.com/acl-dev/acl.git
synced 2024-11-30 10:57:34 +08:00
add member function supoort
This commit is contained in:
parent
bfa1c6eb07
commit
a5feef884b
@ -110,7 +110,7 @@ private:
|
||||
std::string next_token(std::string delimiters);
|
||||
std::string get_namespace();
|
||||
function_code_t gen_unpack_code(const object_t &obj);
|
||||
std::string get_static_string(const std::string &str, int index);
|
||||
std::string get_static_string(const std::string &str, int &index);
|
||||
std::string get_include_files();
|
||||
std::string get_filename(const char *filepath);
|
||||
|
||||
|
@ -633,7 +633,7 @@ bool gsoner::check_comment()
|
||||
return result;
|
||||
}
|
||||
|
||||
std::string gsoner::get_static_string(const std::string &str, int index)
|
||||
std::string gsoner::get_static_string(const std::string &str, int &index)
|
||||
{
|
||||
if (str[index] != '"')
|
||||
return "";
|
||||
@ -668,6 +668,10 @@ std::string gsoner::get_static_string(const std::string &str, int index)
|
||||
index++;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
lines.push_back(str[index]);
|
||||
@ -713,7 +717,6 @@ std::pair<bool, std::string> gsoner::get_function_declare()
|
||||
if (codes_[j] == '"')
|
||||
{
|
||||
std::string str = get_static_string(codes_,j);
|
||||
j += str.size() + 2;
|
||||
}
|
||||
if (codes_[j] == '=')
|
||||
break;
|
||||
@ -886,7 +889,6 @@ bool gsoner::check_function()
|
||||
lines.push_back('"');
|
||||
lines += str;
|
||||
lines.push_back('"');
|
||||
pos_ += str.size();
|
||||
continue;
|
||||
}
|
||||
else if (codes_[pos_] == '}')
|
||||
@ -902,7 +904,9 @@ bool gsoner::check_function()
|
||||
lines.push_back(codes_[pos_]);
|
||||
pos_++;
|
||||
}
|
||||
|
||||
std::cout << "find function:" << std::endl;
|
||||
std::cout << res.second << std::endl;
|
||||
std::cout << lines << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -931,7 +935,6 @@ bool gsoner::check_member()
|
||||
lines.push_back('"');
|
||||
lines += str;
|
||||
lines.push_back('"');
|
||||
pos_ += str.size() + 2;
|
||||
}
|
||||
|
||||
if(codes_[pos_] == ';')
|
||||
@ -1318,9 +1321,6 @@ void gsoner::parse_code()
|
||||
case 's':
|
||||
if(check_struct_begin())
|
||||
continue;
|
||||
case 'v':
|
||||
if(check_function())
|
||||
continue;
|
||||
default:
|
||||
if(check_function())
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user