MCPcopy Create free account
hub / github.com/acl-dev/acl / get_initializelist

Method get_initializelist

lib_acl_cpp/src/serialize/gsoner.cpp:783–863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

781}
782
783std::list<std::string> gsoner::get_initializelist(void)
784{
785 std::list<std::string> initialize_list;
786 std::list<char> syms;
787 std::string line;
788
789 if (codes_[pos_] != ':') {
790 return initialize_list;
791 }
792
793 pos_++;//skip ':'
794
795 while (true) {
796 skip_space_comment();
797 if (codes_[pos_] == '(') {
798 syms.push_back('(');
799 } else if (codes_[pos_] == ')') {
800 if (!syms.size() || syms.back() != '(') {
801 throw syntax_error();
802 }
803
804 line.push_back (')');
805 pos_++;
806
807 syms.pop_back ();
808 if (!syms.empty()) {
809 continue;
810 }
811
812 initialize_list.push_back(line);
813 line.clear();
814
815 while (codes_[pos_] != ',' && codes_[pos_] != '{') {
816 if (!skip_space_comment ()) {
817 pos_++;
818 }
819 }
820
821 if (codes_[pos_] == ',') {
822 pos_++;
823 }
824 continue;
825 } else if (codes_[pos_] == '{') {
826 if (line.empty()) {
827 break;
828 }
829 syms.push_back ('{');
830 } else if (codes_[pos_] == '}') {
831 if (!syms.size() || syms.back() != '{') {
832 throw syntax_error();
833 }
834
835 line.push_back('}');
836 pos_++;
837
838 syms.pop_back();
839 if (!syms.empty()) {
840 continue;

Callers

nothing calls this directly

Calls 7

syntax_errorClass · 0.85
backMethod · 0.80
push_backMethod · 0.45
sizeMethod · 0.45
pop_backMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected