| 10498 | } |
| 10499 | |
| 10500 | function parseFnExpr(source, parts, tokens, exprContext) { |
| 10501 | try { |
| 10502 | var fnName = parts[0].trim().toLowerCase(); |
| 10503 | |
| 10504 | var argSource = tokens[parts[1]].trim(); |
| 10505 | if (argSource.substr(0, 1) === "(") { |
| 10506 | argSource = argSource.substr(1, argSource.length - 2); |
| 10507 | } |
| 10508 | var commaMatchStr = source.indexOf("'") >= 0 ? RX_COMMA_DELIM1 : RX_COMMA_DELIM2; |
| 10509 | var args = argSource.match(commaMatchStr); |
| 10510 | var newContext = __extend({}, exprContext); |
| 10511 | // a dataType of Undefined on a context basically means not to try parsing |
| 10512 | // the value if the expr is a literal |
| 10513 | newContext.dataType = DataType.Undefined; |
| 10514 | newContext.isFnArg = true; |
| 10515 | var exprs = args.map(function (a) { |
| 10516 | return parseExpr(a, tokens, newContext); |
| 10517 | }); |
| 10518 | return new FnExpr(fnName, exprs); |
| 10519 | } catch (e) { |
| 10520 | return null; |
| 10521 | } |
| 10522 | } |
| 10523 | |
| 10524 | var toFunctionVisitor = (function () { |
| 10525 | var visitor = { |