| 863 | } |
| 864 | |
| 865 | bool gsoner::check_function(void) |
| 866 | { |
| 867 | if (status_ != e_struct_begin) { |
| 868 | return false; |
| 869 | } |
| 870 | |
| 871 | int function_begin = pos_; |
| 872 | while (function_begin > 1 && |
| 873 | (codes_[function_begin-1] == '\r' || |
| 874 | codes_[function_begin-1] == '\n'|| |
| 875 | codes_[function_begin-1] == '\t'|| |
| 876 | codes_[function_begin-1] == ' ')) { |
| 877 | |
| 878 | function_begin --; |
| 879 | } |
| 880 | |
| 881 | std::pair<bool, std::string> res = get_function_declare(); |
| 882 | if (!res.first) { |
| 883 | return false; |
| 884 | } |
| 885 | |
| 886 | skip_space_comment(); |
| 887 | //not find function define.just declare only. |
| 888 | if (codes_[pos_] == ';') { |
| 889 | pos_++;//skip ';' sym |
| 890 | return true; |
| 891 | } |
| 892 | if (codes_[pos_] == ':') { |
| 893 | std::list<std::string> initializelist = get_initializelist(); |
| 894 | if (initializelist.empty()) { |
| 895 | throw syntax_error(); |
| 896 | } |
| 897 | //what to do with this code. |
| 898 | } |
| 899 | if (codes_[pos_] == 'c' && |
| 900 | codes_[pos_+1] == 'o'&& |
| 901 | codes_[pos_+2] == 'n'&& |
| 902 | codes_[pos_+3] == 's'&& |
| 903 | codes_[pos_+4] == 't') { |
| 904 | |
| 905 | pos_ += 5; |
| 906 | res.second.append(" const"); |
| 907 | skip_space_comment(); |
| 908 | } |
| 909 | pos_++; |
| 910 | int sym = 1; |
| 911 | std::string lines("{"); |
| 912 | |
| 913 | while (true) { |
| 914 | if (codes_[pos_] == '/') { |
| 915 | if (!check_comment()) { |
| 916 | throw syntax_error(); |
| 917 | } |
| 918 | continue; |
| 919 | } |
| 920 | if (codes_[pos_] == '{') { |
| 921 | sym++; |
| 922 | } |
nothing calls this directly
no test coverage detected