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

Method DefineClassPropertyXet

source/script.cpp:6326–6349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6324
6325
6326ResultType Script::DefineClassPropertyXet(LPTSTR aBuf, LPTSTR aEnd)
6327{
6328 // For simplicity, pass the property definition to DefineFunc instead of the actual
6329 // line text, even though it makes some error messages a bit inaccurate. (That would
6330 // happen anyway when DefineFunc() finds a syntax error in the parameter list.)
6331 if (!DefineFunc(mClassPropertyDef, mClassPropertyStatic))
6332 return FAIL;
6333 if (mClassProperty->MinParams == -1)
6334 {
6335 int hidden_params = ctoupper(*aBuf) == 'S' ? 2 : 1;
6336 mClassProperty->MinParams = g->CurrentFunc->mMinParams - hidden_params;
6337 mClassProperty->MaxParams = g->CurrentFunc->mIsVariadic ? INT_MAX : g->CurrentFunc->mParamCount - hidden_params;
6338 }
6339 if (*aEnd && !AddLine(ACT_BLOCK_BEGIN)) // *aEnd is '{' or '='.
6340 return FAIL;
6341 if (*aEnd == '=') // => expr
6342 {
6343 aEnd = omit_leading_whitespace(aEnd + 2);
6344 if (!ParseAndAddLine(aEnd, ACT_RETURN)
6345 || !AddLine(ACT_BLOCK_END))
6346 return FAIL;
6347 }
6348 return OK;
6349}
6350
6351
6352ResultType Script::DefineClassVars(LPTSTR aBuf, bool aStatic)

Callers

nothing calls this directly

Calls 2

ctoupperFunction · 0.85
omit_leading_whitespaceFunction · 0.85

Tested by

no test coverage detected