Exemplo n.º 1
0
 protected override MSAst.Expression VisitChildren(MSAst.ExpressionVisitor visitor) {
     if (_funcCode != null) {
         MSAst.Expression funcCode = visitor.Visit(_funcCode);
         if (funcCode != _funcCode) {
             DelayedFunctionCode res = new DelayedFunctionCode();
             res._funcCode = funcCode;
             return res;
         }
     }
     return this;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Provides common initialization between top-level and class/function definition ast generators.
        /// </summary>
        private AstGenerator(string name, bool generator, string profilerName, bool print) {
            _print = print;
            _isGenerator = generator;

            _name = name;
            _locals = new ReadOnlyCollectionBuilder<ParameterExpression>();
            _params = new List<ParameterExpression>();

            if (profilerName == null) {
                if (name.IndexOfAny(System.IO.Path.GetInvalidPathChars()) >= 0) {
                    _profilerName = "module " + name;
                } else {
                    _profilerName = "module " + System.IO.Path.GetFileNameWithoutExtension(name);
                }
            } else {
                _profilerName = profilerName;
            }
            _funcCodeExpr = new DelayedFunctionCode();
        }
Exemplo n.º 3
0
 protected override MSAst.Expression VisitChildren(ExpressionVisitor visitor) {
     if (_funcCode != null) {
         MSAst.Expression funcCode = visitor.Visit(_funcCode);
         if (funcCode != _funcCode) {
             DelayedFunctionCode res = new DelayedFunctionCode();
             res._funcCode = funcCode;
             return res;
         }
     }
     return this;
 }