IronRuby.Compiler.Ast.AstGenerator.AddDebugInfo C# (CSharp) Method

AddDebugInfo() private method

private AddDebugInfo ( System.Linq.Expressions expression, Microsoft.Scripting.SourceSpan location ) : Expression
expression System.Linq.Expressions
location Microsoft.Scripting.SourceSpan
return System.Linq.Expressions.Expression
        internal MSA.Expression/*!*/ AddDebugInfo(MSA.Expression/*!*/ expression, SourceSpan location) {
            if (_document != null) {
                // TODO: should we add clearance for non-goto expressions?
                // return AstUtils.AddDebugInfo(expression, _document, location.Start, location.End);
                var sequencePoint = Ast.DebugInfo(_document, location.Start.Line, location.Start.Column, location.End.Line, location.End.Column);
                return Ast.Block(sequencePoint, expression);
            } else {
                return expression;
            }
        }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// Transform and handle the result according to the specified result operation.
        /// </summary>
        internal virtual MSA.Expression/*!*/ TransformResult(AstGenerator/*!*/ gen, ResultOperation resultOperation) {
            MSA.Expression resultExpression = TransformRead(gen);
            MSA.Expression statement;

            if (resultOperation.Variable != null) {
                statement = Ast.Assign(resultOperation.Variable, Ast.Convert(resultExpression, resultOperation.Variable.Type));
            } else {
                statement = gen.Return(resultExpression);
            }

            return gen.AddDebugInfo(statement, Location);
        }
All Usage Examples Of IronRuby.Compiler.Ast.AstGenerator::AddDebugInfo