| 712 | } |
| 713 | |
| 714 | std::pair<bool, std::string> gsoner::get_function_declare(void) |
| 715 | { |
| 716 | if (status_ != e_struct_begin) { |
| 717 | return std::make_pair(false, ""); |
| 718 | } |
| 719 | |
| 720 | int j = pos_; |
| 721 | std::string lines; |
| 722 | skip_space(); |
| 723 | |
| 724 | while (true) { |
| 725 | if (codes_[j] == '/') { |
| 726 | if (!check_comment()) { |
| 727 | throw syntax_error(); |
| 728 | } |
| 729 | continue; |
| 730 | } |
| 731 | if (codes_[j] == '"') { |
| 732 | std::string str = get_static_string(codes_,j); |
| 733 | } |
| 734 | if (codes_[j] == '=') { |
| 735 | break; |
| 736 | } |
| 737 | if (codes_[j] == ';') { |
| 738 | break; |
| 739 | } |
| 740 | if (codes_[j] == '(') { |
| 741 | break; |
| 742 | } |
| 743 | lines.push_back(codes_[j]); |
| 744 | j++; |
| 745 | } |
| 746 | |
| 747 | if (codes_[j] != '(') { |
| 748 | //not function, maybe member field |
| 749 | return std::make_pair(false, ""); |
| 750 | } |
| 751 | |
| 752 | lines.push_back('('); |
| 753 | j++; |
| 754 | int syn = 1; |
| 755 | |
| 756 | while (true) { |
| 757 | if (codes_[j] == '/') { |
| 758 | if (!check_comment()) { |
| 759 | throw syntax_error(); |
| 760 | } |
| 761 | continue; |
| 762 | } |
| 763 | if (codes_[j] == ')') { |
| 764 | syn--; |
| 765 | } |
| 766 | if (syn == 0) { |
| 767 | lines.push_back(codes_[j]); |
| 768 | break; |
| 769 | } |
| 770 | if (codes_[j] == '(') { |
| 771 | syn++; |
nothing calls this directly
no test coverage detected