Beispiel #1
0
 internal ReturnStatement GenReturnStatement(IScope scope, Expression expr = null)
 {
     expr = expr ?? GenExpression(scope, 0);
     if (!(expr is Literal))
     {
         expr = new NonEmptyExpression(expr, GenLiteral(scope));
     }
     return(new ReturnStatement(scope, expr, _depthProtection));
 }
Beispiel #2
0
        internal Expression GenSafeReturnExpression(IScope scope)
        {
            var expr = GenExpression(scope, 0, ExpressionType.VariableExpression | ExpressionType.Literal);

            if (!(expr is Literal))
            {
                expr = new NonEmptyExpression(expr, GenLiteral(scope));
            }
            return(expr);
        }