MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / BalanceExprError

Method BalanceExprError

source/script.cpp:3060–3085  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3058
3059
3060ResultType 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

Callers

nothing calls this directly

Calls 1

sntprintfFunction · 0.85

Tested by

no test coverage detected