本文整理汇总了C#中RubyContext.GetCurrentExceptionBacktrace方法的典型用法代码示例。如果您正苦于以下问题:C# RubyContext.GetCurrentExceptionBacktrace方法的具体用法?C# RubyContext.GetCurrentExceptionBacktrace怎么用?C# RubyContext.GetCurrentExceptionBacktrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RubyContext
的用法示例。
在下文中一共展示了RubyContext.GetCurrentExceptionBacktrace方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetValue
public override object GetValue(RubyContext/*!*/ context, RubyScope scope) {
switch (_id) {
// regular expressions:
case GlobalVariableId.MatchData:
return (scope != null) ? scope.GetInnerMostClosureScope().CurrentMatch : null;
case GlobalVariableId.MatchLastGroup:
return (scope != null) ? scope.GetInnerMostClosureScope().GetCurrentMatchLastGroup() : null;
case GlobalVariableId.MatchPrefix:
// TODO:
throw new NotImplementedException();
case GlobalVariableId.MatchSuffix:
// TODO:
throw new NotImplementedException();
case GlobalVariableId.EntireMatch:
return (scope != null) ? scope.GetInnerMostClosureScope().GetCurrentMatchGroup(0) : null;
// exceptions:
case GlobalVariableId.CurrentException:
return context.CurrentException;
case GlobalVariableId.CurrentExceptionBacktrace:
return context.GetCurrentExceptionBacktrace();
// input:
case GlobalVariableId.InputContent:
return context.InputProvider.Singleton;
case GlobalVariableId.InputFileName:
return context.InputProvider.CurrentFileName;
case GlobalVariableId.LastInputLine:
return (scope != null) ? scope.GetInnerMostClosureScope().LastInputLine : null;
case GlobalVariableId.LastInputLineNumber:
return context.InputProvider.LastInputLineNumber;
case GlobalVariableId.CommandLineArguments:
return context.InputProvider.CommandLineArguments;
// output:
case GlobalVariableId.OutputStream:
return context.StandardOutput;
case GlobalVariableId.ErrorOutputStream:
return context.StandardErrorOutput;
case GlobalVariableId.InputStream:
return context.StandardInput;
// separators:
case GlobalVariableId.InputSeparator:
return context.InputSeparator;
case GlobalVariableId.OutputSeparator:
return context.OutputSeparator;
case GlobalVariableId.StringSeparator:
return context.StringSeparator;
case GlobalVariableId.ItemSeparator:
return context.ItemSeparator;
// loader:
case GlobalVariableId.LoadPath:
return context.Loader.LoadPaths;
case GlobalVariableId.LoadedFiles:
return context.Loader.LoadedFiles;
// misc:
case GlobalVariableId.SafeLevel:
return context.CurrentSafeLevel;
case GlobalVariableId.Verbose:
return context.Verbose;
case GlobalVariableId.KCode:
#if !SILVERLIGHT
if (context.RubyOptions.Compatibility == RubyCompatibility.Ruby18) {
return MutableString.Create(KCoding.GetKCodeName(context.KCode));
}
#endif
context.ReportWarning("variable $KCODE is no longer effective");
return null;
case GlobalVariableId.ChildProcessExitStatus:
return context.ChildProcessExitStatus;
case GlobalVariableId.CommandLineProgramPath:
//.........这里部分代码省略.........
示例2: GetValue
public override object GetValue(RubyContext/*!*/ context, RubyScope scope) {
switch (_id) {
// regular expressions:
case GlobalVariableId.MatchData:
return (scope != null) ? scope.GetInnerMostClosureScope().CurrentMatch : null;
case GlobalVariableId.MatchLastGroup:
return (scope != null) ? scope.GetInnerMostClosureScope().GetCurrentMatchLastGroup() : null;
case GlobalVariableId.MatchPrefix:
// TODO:
throw new NotImplementedException();
case GlobalVariableId.MatchSuffix:
// TODO:
throw new NotImplementedException();
case GlobalVariableId.EntireMatch:
return (scope != null) ? scope.GetInnerMostClosureScope().GetCurrentMatchGroup(0) : null;
// exceptions:
case GlobalVariableId.CurrentException:
return context.CurrentException;
case GlobalVariableId.CurrentExceptionBacktrace:
return context.GetCurrentExceptionBacktrace();
// input:
case GlobalVariableId.InputContent:
return context.InputProvider.Singleton;
case GlobalVariableId.InputFileName:
return context.InputProvider.CurrentFileName;
case GlobalVariableId.LastInputLine:
return (scope != null) ? scope.GetInnerMostClosureScope().LastInputLine : null;
case GlobalVariableId.LastInputLineNumber:
return context.InputProvider.LastInputLineNumber;
case GlobalVariableId.CommandLineArguments:
return context.InputProvider.CommandLineArguments;
// output:
case GlobalVariableId.OutputStream:
return context.StandardOutput;
case GlobalVariableId.ErrorOutputStream:
return context.StandardErrorOutput;
case GlobalVariableId.InputStream:
return context.StandardInput;
// separators:
case GlobalVariableId.InputSeparator:
return context.InputSeparator;
case GlobalVariableId.OutputSeparator:
return context.OutputSeparator;
case GlobalVariableId.StringSeparator:
return context.StringSeparator;
case GlobalVariableId.ItemSeparator:
return context.ItemSeparator;
// loader:
case GlobalVariableId.LoadPath:
return context.Loader.LoadPaths;
case GlobalVariableId.LoadedFiles:
return context.Loader.LoadedFiles;
// misc:
case GlobalVariableId.SafeLevel:
return context.CurrentSafeLevel;
case GlobalVariableId.Verbose:
return context.Verbose;
case GlobalVariableId.KCode:
// TODO: Ruby 1.9 reports a warning:
string name = context.GetKCodeName();
return (name != null) ? MutableString.Create(name) : null;
case GlobalVariableId.ChildProcessExitStatus:
return context.ChildProcessExitStatus;
default:
throw Assert.Unreachable;
}
}