packages/okam-build/lib/processor/template/transform/base/event.js
function parseHandlerByREGEXP(handlerString) {
    // match handlerName and handle arguments
    const matchArray = handlerString.match(EVENT_HANDLE_REGEXP);
    const handlerName = matchArray && matchArray[1] || '';
    let handlerArgs = matchArray && matchArray[2] || '';
    let eventObjectAlias = '';

    // when there are arguments in function, use __handlerProxy(okam-core/base/component) to handle arguments
    if (handlerArgs && handlerArgs.length > 0) {
        // 避免相邻$event不能被正确的替换e.g. "$event,$event"
        if (handlerArgs.includes(',$event')) {
            handlerArgs = handlerArgs.replace(/,\$event/g, ', $event');
        }

        const pseudoArgsArray = handlerArgs.replace(/\s*/g, '').split(',');
        // transform $event to 'eventObjectAlias', for handleProxy passing on the event Object
        if (pseudoArgsArray.includes('$event')) {
            eventObjectAlias = `${getRandomStringNotIn(handlerArgs)}_$event`;
            handlerArgs = ` ${handlerArgs} `.replace(VARIABLE_EVENT, `$1'${eventObjectAlias}'$2`).trim();
        }
    }
    return {
        handlerName,
        handlerArgs,
        eventObjectAlias
    };
}
function parseHandlerByREGEXP(handlerString) {
    // match handlerName and handle arguments
    const matchArray = handlerString.match(EVENT_HANDLE_REGEXP);
    const handlerName = matchArray && matchArray[1] || '';
    let handlerArgs = matchArray && matchArray[2] || '';
    let eventObjectAlias = '';

    // when there are arguments in function, use __handlerProxy(okam-core/base/component) to handle arguments
    if (handlerArgs && handlerArgs.length > 0) {
        // 避免相邻$event不能被正确的替换e.g. "$event,$event"
        if (handlerArgs.includes(',$event')) {
            handlerArgs = handlerArgs.replace(/,\$event/g, ', $event');
        }

        const pseudoArgsArray = handlerArgs.replace(/\s*/g, '').split(',');
        // transform $event to 'eventObjectAlias', for handleProxy passing on the event Object
        if (pseudoArgsArray.includes('$event')) {
            eventObjectAlias = `${getRandomStringNotIn(handlerArgs)}_$event`;
            handlerArgs = ` ${handlerArgs} `.replace(VARIABLE_EVENT, `$1'${eventObjectAlias}'$2`).trim();
        }
    }
    return {
        handlerName,
        handlerArgs,
        eventObjectAlias
    };
}
parse handlerString to function name and function arguments，replace $event
解析函数名及参数

eg:
<view @click="handleClick($event, '$event')"></view>
会被解析为
<view bindtap="__handlerProxy"
data-tap-event-proxy="handleClick"
data-tap-arguments-proxy="{{['u2mirq0709_$event', '$event'}}"
data-tap-event-object-alias="u2mirq0709_$event"></view>

其中$event加上随机数前缀的原因是：
如果未对$event做转换，即<view data-tap-arguments-proxy="{{[$event, '$event'}}"></view>，那么模板被渲染时，会因为找不到对应的变量$event而报错。
因此需要将$event转换为字符串，但是为了避免用户也传递了字符串'$event'导致__handleProxy误解析，所以加上前缀以区分。
同时，由于加任何前缀，都有可能碰上用户巧合传递了同样的字符串，避免传参重复。所以用随机数作前缀（取到随机数后还会判断是否在参数列表中，在的话重取）。

@param {string} handlerString   the whole string
@return {Object}
handlerName: function name,
handlerArgs: function arguments
eventObjectAlias: the event object alias