public static global::Array <object> makeStack(global::System.Diagnostics.StackTrace s) { global::Array <object> stack = new global::Array <object>(new object[] {}); { int _g1 = 0; int _g = s.FrameCount; while ((_g1 < _g)) { int i = _g1++; global::System.Diagnostics.StackFrame frame = s.GetFrame(((int)(i))); global::System.Reflection.MethodBase m = frame.GetMethod(); if ((m == null)) { continue; } global::haxe.StackItem method = global::haxe.StackItem.Method(((m as global::System.Reflection.MemberInfo).ReflectedType as global::System.Reflection.MemberInfo).ToString(), (m as global::System.Reflection.MemberInfo).Name); string fileName = frame.GetFileName(); int lineNumber = frame.GetFileLineNumber(); if ((!(string.Equals(fileName, null)) || (lineNumber >= 0))) { stack.push(global::haxe.StackItem.FilePos(method, fileName, lineNumber)); } else { stack.push(method); } } } return(stack); }
public static string toString(global::Array <object> stack) { #line 71 "/opt/haxe/std/haxe/CallStack.hx" global::StringBuf b = new global::StringBuf(); { #line 72 "/opt/haxe/std/haxe/CallStack.hx" int _g = 0; #line 72 "/opt/haxe/std/haxe/CallStack.hx" global::Array <object> _g1 = ((global::Array <object>)(stack)); #line 72 "/opt/haxe/std/haxe/CallStack.hx" while ((_g < _g1.length)) { #line 72 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.StackItem s = ((global::haxe.StackItem)(_g1[_g])); #line 72 "/opt/haxe/std/haxe/CallStack.hx" ++_g; b.b.Append(((string)("\nCalled from "))); #line 74 "/opt/haxe/std/haxe/CallStack.hx" global::haxe._CallStack.CallStack_Impl_.itemToString(b, s); } } #line 76 "/opt/haxe/std/haxe/CallStack.hx" return(b.b.ToString()); }
public StackItem_FilePos(global::haxe.StackItem s, string file, int line, global::haxe.lang.Null <int> column) : base(2) { #line 31 "/opt/haxe/std/haxe/CallStack.hx" this.s = s; #line 31 "/opt/haxe/std/haxe/CallStack.hx" this.file = file; #line 31 "/opt/haxe/std/haxe/CallStack.hx" this.line = line; #line 31 "/opt/haxe/std/haxe/CallStack.hx" this.column = column; }
public static string toString(global::Array <object> stack) { global::StringBuf b = new global::StringBuf(); { int _g = 0; while ((_g < stack.length)) { global::haxe.StackItem s = ((global::haxe.StackItem)(stack[_g])); ++_g; b.b.Append(((string)("\nCalled from "))); global::haxe.CallStack.itemToString(b, s); } } return(b.b.ToString()); }
public static global::Array <object> toHaxe(global::System.Diagnostics.StackTrace native, global::haxe.lang.Null <int> skip) { #line 31 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" int skip1 = ((!(skip.hasValue)) ? (0) : ((skip).@value)); global::Array <object> stack = new global::Array <object>(new object[] {}); #line 33 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" if ((native == null)) { #line 34 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" return(stack); } #line 36 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" int cnt = 0; { #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" int _g = 0; #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" int _g1 = native.FrameCount; #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" while ((_g < _g1)) { #line 37 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" int i = _g++; global::System.Diagnostics.StackFrame frame = native.GetFrame(((int)(i))); #line 39 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" global::System.Reflection.MethodBase m = frame.GetMethod(); #line 41 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" if ((m == null)) { #line 42 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" continue; } #line 44 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" if ((skip1 > cnt++)) { #line 45 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" continue; } #line 48 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" global::haxe.StackItem method = global::haxe.StackItem.Method(((m as global::System.Reflection.MemberInfo).ReflectedType as global::System.Reflection.MemberInfo).ToString(), (m as global::System.Reflection.MemberInfo).Name); #line 50 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" string fileName = frame.GetFileName(); int lineNumber = frame.GetFileLineNumber(); #line 53 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" if (((fileName != null) || (lineNumber >= 0))) { #line 54 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" stack.push(global::haxe.StackItem.FilePos(method, fileName, lineNumber, default(global::haxe.lang.Null <int>))); } else { #line 56 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" stack.push(method); } } } #line 58 "/opt/haxe/std/cs/_std/haxe/NativeStackTrace.hx" return(stack); }
public static void itemToString(global::StringBuf b, global::haxe.StackItem s) { unchecked { #line 155 "/opt/haxe/std/haxe/CallStack.hx" switch (s._hx_index) { case 0: { #line 157 "/opt/haxe/std/haxe/CallStack.hx" b.b.Append(((string)("a C function"))); #line 157 "/opt/haxe/std/haxe/CallStack.hx" break; } case 1: { #line 158 "/opt/haxe/std/haxe/CallStack.hx" string m = (s as global::haxe.StackItem_Module).m; #line 158 "/opt/haxe/std/haxe/CallStack.hx" { #line 159 "/opt/haxe/std/haxe/CallStack.hx" b.b.Append(((string)("module "))); b.b.Append(((string)(global::Std.@string(m)))); } #line 158 "/opt/haxe/std/haxe/CallStack.hx" break; } case 2: { #line 161 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.lang.Null <int> col = (s as global::haxe.StackItem_FilePos).column; #line 161 "/opt/haxe/std/haxe/CallStack.hx" int line = (s as global::haxe.StackItem_FilePos).line; #line 161 "/opt/haxe/std/haxe/CallStack.hx" string file = (s as global::haxe.StackItem_FilePos).file; #line 161 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.StackItem s1 = (s as global::haxe.StackItem_FilePos).s; #line 161 "/opt/haxe/std/haxe/CallStack.hx" { #line 162 "/opt/haxe/std/haxe/CallStack.hx" if ((s1 != null)) { #line 163 "/opt/haxe/std/haxe/CallStack.hx" global::haxe._CallStack.CallStack_Impl_.itemToString(b, s1); b.b.Append(((string)(" ("))); } #line 166 "/opt/haxe/std/haxe/CallStack.hx" b.b.Append(((string)(global::Std.@string(file)))); b.b.Append(((string)(" line "))); #line 168 "/opt/haxe/std/haxe/CallStack.hx" b.b.Append(((string)(global::Std.@string(line)))); if (col.hasValue) { #line 170 "/opt/haxe/std/haxe/CallStack.hx" b.b.Append(((string)(" column "))); b.b.Append(((string)(global::Std.@string((col).toDynamic())))); } #line 173 "/opt/haxe/std/haxe/CallStack.hx" if ((s1 != null)) { #line 174 "/opt/haxe/std/haxe/CallStack.hx" b.b.Append(((string)(")"))); } } #line 161 "/opt/haxe/std/haxe/CallStack.hx" break; } case 3: { #line 175 "/opt/haxe/std/haxe/CallStack.hx" string meth = (s as global::haxe.StackItem_Method).method; #line 175 "/opt/haxe/std/haxe/CallStack.hx" string cname = (s as global::haxe.StackItem_Method).classname; #line 175 "/opt/haxe/std/haxe/CallStack.hx" { #line 176 "/opt/haxe/std/haxe/CallStack.hx" b.b.Append(((string)(global::Std.@string((((cname == null)) ? ("<unknown>") : (cname)))))); b.b.Append(((string)("."))); #line 178 "/opt/haxe/std/haxe/CallStack.hx" b.b.Append(((string)(global::Std.@string(meth)))); } #line 175 "/opt/haxe/std/haxe/CallStack.hx" break; } case 4: { #line 179 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.lang.Null <int> n = (s as global::haxe.StackItem_LocalFunction).v; #line 179 "/opt/haxe/std/haxe/CallStack.hx" { #line 180 "/opt/haxe/std/haxe/CallStack.hx" b.b.Append(((string)("local function #"))); b.b.Append(((string)(global::Std.@string((n).toDynamic())))); } #line 179 "/opt/haxe/std/haxe/CallStack.hx" break; } } } #line default }
public static bool equalItems(global::haxe.StackItem item1, global::haxe.StackItem item2) { unchecked { #line 119 "/opt/haxe/std/haxe/CallStack.hx" if ((item1 == null)) { #line 120 "/opt/haxe/std/haxe/CallStack.hx" if ((item2 == null)) { #line 120 "/opt/haxe/std/haxe/CallStack.hx" return(true); } else { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } } else { #line 119 "/opt/haxe/std/haxe/CallStack.hx" switch (item1._hx_index) { case 0: { #line 119 "/opt/haxe/std/haxe/CallStack.hx" if ((item2 == null)) { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } else if ((item2._hx_index == 0)) { #line 121 "/opt/haxe/std/haxe/CallStack.hx" return(true); } else { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } } case 1: { #line 119 "/opt/haxe/std/haxe/CallStack.hx" if ((item2 == null)) { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } else if ((item2._hx_index == 1)) { #line 122 "/opt/haxe/std/haxe/CallStack.hx" string m1 = (item1 as global::haxe.StackItem_Module).m; #line 122 "/opt/haxe/std/haxe/CallStack.hx" string m2 = (item2 as global::haxe.StackItem_Module).m; return(m1 == m2); } else { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } } case 2: { #line 119 "/opt/haxe/std/haxe/CallStack.hx" if ((item2 == null)) { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } else if ((item2._hx_index == 2)) { #line 124 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.StackItem item11 = (item1 as global::haxe.StackItem_FilePos).s; #line 124 "/opt/haxe/std/haxe/CallStack.hx" string file1 = (item1 as global::haxe.StackItem_FilePos).file; #line 124 "/opt/haxe/std/haxe/CallStack.hx" int line1 = (item1 as global::haxe.StackItem_FilePos).line; #line 124 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.lang.Null <int> col1 = (item1 as global::haxe.StackItem_FilePos).column; #line 124 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.lang.Null <int> col2 = (item2 as global::haxe.StackItem_FilePos).column; #line 124 "/opt/haxe/std/haxe/CallStack.hx" int line2 = (item2 as global::haxe.StackItem_FilePos).line; #line 124 "/opt/haxe/std/haxe/CallStack.hx" string file2 = (item2 as global::haxe.StackItem_FilePos).file; #line 124 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.StackItem item21 = (item2 as global::haxe.StackItem_FilePos).s; if ((((file1 == file2) && (line1 == line2)) && global::haxe.lang.Runtime.eq((col1).toDynamic(), (col2).toDynamic()))) { #line 125 "/opt/haxe/std/haxe/CallStack.hx" return(global::haxe._CallStack.CallStack_Impl_.equalItems(item11, item21)); } else { #line 125 "/opt/haxe/std/haxe/CallStack.hx" return(false); } } else { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } } case 3: { #line 119 "/opt/haxe/std/haxe/CallStack.hx" if ((item2 == null)) { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } else if ((item2._hx_index == 3)) { #line 126 "/opt/haxe/std/haxe/CallStack.hx" string class1 = (item1 as global::haxe.StackItem_Method).classname; #line 126 "/opt/haxe/std/haxe/CallStack.hx" string method1 = (item1 as global::haxe.StackItem_Method).method; #line 126 "/opt/haxe/std/haxe/CallStack.hx" string method2 = (item2 as global::haxe.StackItem_Method).method; #line 126 "/opt/haxe/std/haxe/CallStack.hx" string class2 = (item2 as global::haxe.StackItem_Method).classname; if ((class1 == class2)) { #line 127 "/opt/haxe/std/haxe/CallStack.hx" return(method1 == method2); } else { #line 127 "/opt/haxe/std/haxe/CallStack.hx" return(false); } } else { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } } case 4: { #line 119 "/opt/haxe/std/haxe/CallStack.hx" if ((item2 == null)) { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } else if ((item2._hx_index == 4)) { #line 128 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.lang.Null <int> v1 = (item1 as global::haxe.StackItem_LocalFunction).v; #line 128 "/opt/haxe/std/haxe/CallStack.hx" global::haxe.lang.Null <int> v2 = (item2 as global::haxe.StackItem_LocalFunction).v; return(global::haxe.lang.Runtime.eq((v1).toDynamic(), (v2).toDynamic())); } else { #line 130 "/opt/haxe/std/haxe/CallStack.hx" return(false); } } } } #line 118 "/opt/haxe/std/haxe/CallStack.hx" return(default(bool)); } #line default }
public static global::haxe.StackItem FilePos(global::haxe.StackItem s, string file, int line, global::haxe.lang.Null <int> column) { #line 31 "/opt/haxe/std/haxe/CallStack.hx" return(new global::haxe.StackItem_FilePos(s, file, line, column)); }
public static void itemToString(global::StringBuf b, global::haxe.StackItem s) { unchecked { switch (s.index) { case 0: { b.b.Append(((string)("a C function"))); break; } case 1: { string m = global::haxe.lang.Runtime.toString(s.@params[0]); { b.b.Append(((string)("module "))); b.b.Append(((string)(global::Std.@string(m)))); } break; } case 2: { int line = ((int)(global::haxe.lang.Runtime.toInt(s.@params[2]))); string file = global::haxe.lang.Runtime.toString(s.@params[1]); global::haxe.StackItem s1 = ((global::haxe.StackItem)(s.@params[0])); { if ((s1 != null)) { global::haxe.CallStack.itemToString(b, s1); b.b.Append(((string)(" ("))); } b.b.Append(((string)(global::Std.@string(file)))); b.b.Append(((string)(" line "))); b.b.Append(((string)(global::Std.@string(line)))); if ((s1 != null)) { b.b.Append(((string)(")"))); } } break; } case 3: { string meth = global::haxe.lang.Runtime.toString(s.@params[1]); string cname = global::haxe.lang.Runtime.toString(s.@params[0]); { b.b.Append(((string)(global::Std.@string(cname)))); b.b.Append(((string)("."))); b.b.Append(((string)(global::Std.@string(meth)))); } break; } case 4: { global::haxe.lang.Null <int> n = global::haxe.lang.Null <object> .ofDynamic <int>(s.@params[0]); { b.b.Append(((string)("local function #"))); b.b.Append(((string)(global::Std.@string((n).toDynamic())))); } break; } } } }
public static global::haxe.StackItem FilePos(global::haxe.StackItem s, string file, int line) { unchecked { return(new global::haxe.StackItem(2, new object[] { s, file, line })); } }