nl_tokens: parse handlerString to function name and function arguments，replace $event 解析函数名及参数
pl_tokens: 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 . <mask> ( '$event' ) ) { eventObjectAlias = ` ${ getRandomStringNotIn ( handlerArgs ) } ` ; handlerArgs = ` ${ handlerArgs } ` . replace ( VARIABLE_EVENT , ` ${ eventObjectAlias } ` ) . trim ( ) ; } } return { handlerName , handlerArgs , eventObjectAlias } ; }