| 3058 | |
| 3059 | |
| 3060 | ResultType Script::BalanceExprError(int aBalance, TCHAR aExpect[], LPTSTR aLineText) |
| 3061 | { |
| 3062 | TCHAR expected, found; |
| 3063 | if (aBalance < 0) |
| 3064 | { |
| 3065 | expected = aExpect[0]; |
| 3066 | found = aExpect[1]; |
| 3067 | } |
| 3068 | else |
| 3069 | { |
| 3070 | expected = aBalance < MAX_BALANCEEXPR_DEPTH ? aExpect[aBalance - 1] : 0; |
| 3071 | found = 0; |
| 3072 | } |
| 3073 | TCHAR msgbuf[40]; |
| 3074 | LPTSTR msgfmt; |
| 3075 | if (expected && found) |
| 3076 | msgfmt = _T("Missing \"%c\" before \"%c\""); |
| 3077 | else if (found) |
| 3078 | msgfmt = _T("Unexpected \"%c\""), expected = found; |
| 3079 | else if (expected) |
| 3080 | msgfmt = _T("Missing \"%c\""); |
| 3081 | else |
| 3082 | msgfmt = _T("Missing symbol"); // Rare case (expression too deep to keep track of what's missing). |
| 3083 | sntprintf(msgbuf, _countof(msgbuf), msgfmt, expected, found); |
| 3084 | return ScriptError(msgbuf, aLineText); |
| 3085 | } |
| 3086 | |
| 3087 | |
| 3088 |
nothing calls this directly
no test coverage detected