findMatchingTokenBeforeIndex

Finds the last token of a specific type before a given index in the list of function call tokens. If a reset token is encountered, it discards the match.

Example (let | be the cursor position in the text):

.function param1:{arg1} param2:{ar|g2}

Calling this function with:

Return

the last matching token before the specified index, or null if no match is found

Parameters

beforeIndex

the index before which to search for the matching token

matchType

the type of token to match

reset

a set of token types that will reset the match if encountered