Exemplo n.º 1
0
        private IExpression ParseFunction()
        {
            var identifier = Take(TokenType.Identifier);

            Take(TokenType.LeftBracket);
            List <IExpression> exprList = new List <IExpression>();

            while (_currentToken.Type != TokenType.RightBracket)
            {
                exprList.Add(ParseExpression());
                if (_currentToken.Type == TokenType.Comma)
                {
                    Take(TokenType.Comma);
                }
            }
            Take(TokenType.RightBracket);

            var result = LookUpStandartFunction(identifier.Value, exprList) ??
                         _functionManager.LookUpCustomFunction(identifier.Value, exprList);

            return(result);
        }