| 768 | } |
| 769 | |
| 770 | bool isToken(std::string text, int position, std::string token) |
| 771 | { |
| 772 | size_t tokenend = position + token.size(); |
| 773 | if(text.size() > tokenend) |
| 774 | { |
| 775 | if(!std::isspace(text[tokenend])) |
| 776 | { |
| 777 | return false; |
| 778 | } |
| 779 | } |
| 780 | for(int i = position - 1; i >= 0; --i) |
| 781 | { |
| 782 | if(text[i] == ';') |
| 783 | { |
| 784 | return false; |
| 785 | } |
| 786 | else if(text[i] == '\n') |
| 787 | { |
| 788 | return true; |
| 789 | } |
| 790 | } |
| 791 | return true; |
| 792 | } |
| 793 | |
| 794 | int findToken(std::string text, std::string token, int position) |
| 795 | { |