| 805 | } |
| 806 | |
| 807 | int CScriptBuilder::SkipStatement(int pos) |
| 808 | { |
| 809 | asUINT len = 0; |
| 810 | |
| 811 | // Skip until ; or { whichever comes first |
| 812 | while( pos < (int)modifiedScript.length() && modifiedScript[pos] != ';' && modifiedScript[pos] != '{' ) |
| 813 | { |
| 814 | engine->ParseToken(&modifiedScript[pos], modifiedScript.size() - pos, &len); |
| 815 | pos += len; |
| 816 | } |
| 817 | |
| 818 | // Skip entire statement block |
| 819 | if( pos < (int)modifiedScript.length() && modifiedScript[pos] == '{' ) |
| 820 | { |
| 821 | pos += 1; |
| 822 | |
| 823 | // Find the end of the statement block |
| 824 | int level = 1; |
| 825 | while( level > 0 && pos < (int)modifiedScript.size() ) |
| 826 | { |
| 827 | asETokenClass t = engine->ParseToken(&modifiedScript[pos], modifiedScript.size() - pos, &len); |
| 828 | if( t == asTC_KEYWORD ) |
| 829 | { |
| 830 | if( modifiedScript[pos] == '{' ) |
| 831 | level++; |
| 832 | else if( modifiedScript[pos] == '}' ) |
| 833 | level--; |
| 834 | } |
| 835 | |
| 836 | pos += len; |
| 837 | } |
| 838 | } |
| 839 | else |
| 840 | pos += 1; |
| 841 | |
| 842 | return pos; |
| 843 | } |
| 844 | |
| 845 | // Overwrite all code with blanks until the matching #endif |
| 846 | int CScriptBuilder::ExcludeCode(int pos) |
nothing calls this directly
no test coverage detected