Ejemplo n.º 1
0
        internal DisplayStackTraceEntry CreateDisplayStackTraceEntry(ImmutableContextBase context, LineInfo lastCallSite)
        {
            if (m_ambientCall != null)
            {
                var loc = new Location {
                    File = "[ambient call]", Line = -1, Position = -1
                };
                var functionName = m_ambientCall.Functor.ToDisplayString(context);
                return(new DisplayStackTraceEntry(loc, functionName, this));
            }

            if (Lambda != null)
            {
                var        location     = lastCallSite.AsLoggingLocation(Env, context);
                SymbolAtom?methodName   = Lambda?.Name;
                var        functionName = methodName?.IsValid == true?methodName.Value.ToString(context.StringTable) : "<lambda>";

                return(new DisplayStackTraceEntry(location, functionName, this));
            }

            throw Contract.AssertFailure("The code is effectively unreacheable.");
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns location for logging.
 /// </summary>
 /// <returns>
 /// This method materialize a location!
 /// </returns>
 public Location AsLoggingLocation()
 {
     return(m_lineInfo.AsLoggingLocation(m_absolutePath.ToString(m_pathTable)));
 }