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

Method ParseDoubleDeref

source/script.cpp:5632–5668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5630
5631
5632ResultType Script::ParseDoubleDeref(LPTSTR aArgText, LPTSTR aArgMap, DerefList &aDeref, int *aPos)
5633{
5634 LPTSTR op_begin, dd_begin;
5635 LPTSTR op_end;
5636 DerefType *last = NULL;
5637 int count = 0;
5638 for (op_begin = dd_begin = aArgText + *aPos; ; op_begin = op_end + 1)
5639 {
5640 op_end = find_identifier_end(op_begin);
5641
5642 // String "derefs" are needed to pair up to the '%' markers, allowing both
5643 // to be optimized out if the string is empty (as on either side of %a%).
5644 if (!aDeref.Push())
5645 return ScriptError(ERR_OUTOFMEM);
5646 DerefType &this_deref = *aDeref.Last();
5647 this_deref.type = DT_STRING;
5648 this_deref.next = NULL;
5649 this_deref.marker = op_begin;
5650 this_deref.length = DerefLengthType(op_end - op_begin);
5651 this_deref.substring_count = ++count;
5652
5653 if (last)
5654 last->next = &this_deref;
5655 last = &this_deref;
5656
5657 *aPos = int(op_end - aArgText);
5658 if (*op_end != g_DerefChar)
5659 break;
5660 (*aPos)++;
5661 if (!ParseOperands(aArgText, aArgMap, aDeref, aPos, g_DerefChar))
5662 return FAIL;
5663 op_end = aArgText + *aPos;
5664 if (*op_end != g_DerefChar)
5665 return ScriptError(_T("Missing ending \"%\""), op_begin);
5666 }
5667 return OK;
5668}
5669
5670
5671SymbolType Script::ConvertWordOperator(LPCTSTR aWord, size_t aLength)

Callers

nothing calls this directly

Calls 3

find_identifier_endFunction · 0.85
LastMethod · 0.80
PushMethod · 0.45

Tested by

no test coverage detected