Example #1
0
        private Expr TryEvaluate(ExprNode e, string exprStr)
        {
            Expr   expr;
            object?constantValue = null;

            try {
                constantValue = ConstantExpressionEvaluator.Evaluate(e);
            } catch {
            }

            if (constantValue is { })
Example #2
0
        public static bool TryEvaluateAs <T>(ExprNode node, out T result)
        {
            object?res = new ConstantExpressionEvaluator().Visit(node);

            if (res is { } && res is T castRes)