Commit 34d8ed8e authored by Kirill Smelkov's avatar Kirill Smelkov

X pystone: Manually print traceback (grumpy only prints exception without traceback)

parent 45635ded
#!/bin/sh -e
grumpc pystone.py >pystone.go && go run pystone.go
......@@ -2,6 +2,7 @@ package main
import (
π___python__Γsys "__python__/sys"
π___python__Γtime "__python__/time"
π___python__Γtraceback "__python__/traceback"
πg "grumpy"
π_os "os"
)
......@@ -68,10 +69,12 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
ßnargs := πg.InternStr("nargs")
ßobject := πg.InternStr("object")
ßord := πg.InternStr("ord")
ßprint_exc := πg.InternStr("print_exc")
ßpystones := πg.InternStr("pystones")
ßrange := πg.InternStr("range")
ßsys := πg.InternStr("sys")
ßtime := πg.InternStr("time")
ßtraceback := πg.InternStr("traceback")
var πTemp001 *πg.Object
_ = πTemp001
var πTemp002 []*πg.Object
......@@ -131,6 +134,7 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
switch πF.State() {
case 0:
case 8: goto Label8
case 11: goto Label11
default: panic("unexpected function state")
}
// line 3: """
......@@ -160,13 +164,22 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßclock.ToObject(), πTemp003); πE != nil {
continue
}
// line 41: __version__ = "1.1"
πF.SetLineno(41)
// line 40: import traceback
πF.SetLineno(40)
if πTemp002, πE = πg.ImportModule(πF, "traceback", []*πg.Code{π___python__Γtraceback.Code}); πE != nil {
continue
}
πTemp001 = πTemp002[0]
if πE = πF.Globals().SetItem(πF, ßtraceback.ToObject(), πTemp001); πE != nil {
continue
}
// line 42: __version__ = "1.1"
πF.SetLineno(42)
if πE = πF.Globals().SetItem(πF, ß__version__.ToObject(), πg.NewStr("1.1").ToObject()); πE != nil {
continue
}
// line 43: [Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6)
πF.SetLineno(43)
// line 44: [Ident1, Ident2, Ident3, Ident4, Ident5] = range(1, 6)
πF.SetLineno(44)
πTemp002 = πF.MakeArgs(2)
πTemp002[0] = πg.NewInt(1).ToObject()
πTemp002[1] = πg.NewInt(6).ToObject()
......@@ -195,8 +208,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßIdent5.ToObject(), πTemp007); πE != nil {
continue
}
// line 45: class Record(object):
πF.SetLineno(45)
// line 46: class Record(object):
πF.SetLineno(46)
πTemp002 = make([]*πg.Object, 1)
if πTemp004, πE = πg.ResolveGlobal(πF, ßobject); πE != nil {
continue
......@@ -224,8 +237,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 47: def __init__(self, PtrComp = None, Discr = 0, EnumComp = 0,
πF.SetLineno(47)
// line 48: def __init__(self, PtrComp = None, Discr = 0, EnumComp = 0,
πF.SetLineno(48)
πTemp002 = make([]πg.Param, 6)
πTemp002[0] = πg.Param{Name: "self", Def: nil}
if πTemp003, πE = πg.ResolveClass(πF, πClass, nil, ßNone); πE != nil {
......@@ -251,8 +264,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 49: self.PtrComp = PtrComp
πF.SetLineno(49)
// line 50: self.PtrComp = PtrComp
πF.SetLineno(50)
if πE = πg.CheckLocal(πF, µPtrComp, "PtrComp"); πE != nil {
continue
}
......@@ -265,8 +278,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µself, ßPtrComp, πTemp001); πE != nil {
continue
}
// line 50: self.Discr = Discr
πF.SetLineno(50)
// line 51: self.Discr = Discr
πF.SetLineno(51)
if πE = πg.CheckLocal(πF, µDiscr, "Discr"); πE != nil {
continue
}
......@@ -279,8 +292,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µself, ßDiscr, πTemp001); πE != nil {
continue
}
// line 51: self.EnumComp = EnumComp
πF.SetLineno(51)
// line 52: self.EnumComp = EnumComp
πF.SetLineno(52)
if πE = πg.CheckLocal(πF, µEnumComp, "EnumComp"); πE != nil {
continue
}
......@@ -293,8 +306,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µself, ßEnumComp, πTemp001); πE != nil {
continue
}
// line 52: self.IntComp = IntComp
πF.SetLineno(52)
// line 53: self.IntComp = IntComp
πF.SetLineno(53)
if πE = πg.CheckLocal(πF, µIntComp, "IntComp"); πE != nil {
continue
}
......@@ -307,8 +320,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µself, ßIntComp, πTemp001); πE != nil {
continue
}
// line 53: self.StringComp = StringComp
πF.SetLineno(53)
// line 54: self.StringComp = StringComp
πF.SetLineno(54)
if πE = πg.CheckLocal(πF, µStringComp, "StringComp"); πE != nil {
continue
}
......@@ -328,8 +341,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πClass.SetItem(πF, ß__init__.ToObject(), πTemp001); πE != nil {
continue
}
// line 55: def copy(self):
πF.SetLineno(55)
// line 56: def copy(self):
πF.SetLineno(56)
πTemp002 = make([]πg.Param, 1)
πTemp002[0] = πg.Param{Name: "self", Def: nil}
πTemp003 = πg.NewFunction(πg.NewCode("copy", "pystone.py", πTemp002, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
......@@ -346,8 +359,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 56: return Record(self.PtrComp, self.Discr, self.EnumComp,
πF.SetLineno(56)
// line 57: return Record(self.PtrComp, self.Discr, self.EnumComp,
πF.SetLineno(57)
πTemp001 = πF.MakeArgs(5)
if πE = πg.CheckLocal(πF, µself, "self"); πE != nil {
continue
......@@ -418,18 +431,18 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßRecord.ToObject(), πTemp004); πE != nil {
continue
}
// line 59: TRUE = 1
πF.SetLineno(59)
// line 60: TRUE = 1
πF.SetLineno(60)
if πE = πF.Globals().SetItem(πF, ßTRUE.ToObject(), πg.NewInt(1).ToObject()); πE != nil {
continue
}
// line 60: FALSE = 0
πF.SetLineno(60)
// line 61: FALSE = 0
πF.SetLineno(61)
if πE = πF.Globals().SetItem(πF, ßFALSE.ToObject(), πg.NewInt(0).ToObject()); πE != nil {
continue
}
// line 62: def main(loops=LOOPS):
πF.SetLineno(62)
// line 63: def main(loops=LOOPS):
πF.SetLineno(63)
πTemp009 = make([]πg.Param, 1)
if πTemp003, πE = πg.ResolveGlobal(πF, ßLOOPS); πE != nil {
continue
......@@ -453,8 +466,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 63: benchtime, stones = pystones(loops)
πF.SetLineno(63)
// line 64: benchtime, stones = pystones(loops)
πF.SetLineno(64)
πTemp001 = πF.MakeArgs(1)
if πE = πg.CheckLocal(πF, µloops, "loops"); πE != nil {
continue
......@@ -472,8 +485,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
}
µbenchtime = πTemp002
µstones = πTemp004
// line 64: print "Pystone(%s) time for %d passes = %g" % \
πF.SetLineno(64)
// line 65: print "Pystone(%s) time for %d passes = %g" % \
πF.SetLineno(65)
πTemp001 = make([]*πg.Object, 1)
if πTemp004, πE = πg.ResolveGlobal(πF, ß__version__); πE != nil {
continue
......@@ -492,8 +505,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.Print(πF, πTemp001, true); πE != nil {
continue
}
// line 66: print "This machine benchmarks at %g pystones/second" % stones
πF.SetLineno(66)
// line 67: print "This machine benchmarks at %g pystones/second" % stones
πF.SetLineno(67)
πTemp001 = make([]*πg.Object, 1)
if πE = πg.CheckLocal(πF, µstones, "stones"); πE != nil {
continue
......@@ -512,8 +525,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßmain.ToObject(), πTemp001); πE != nil {
continue
}
// line 69: def pystones(loops=LOOPS):
πF.SetLineno(69)
// line 70: def pystones(loops=LOOPS):
πF.SetLineno(70)
πTemp009 = make([]πg.Param, 1)
if πTemp004, πE = πg.ResolveGlobal(πF, ßLOOPS); πE != nil {
continue
......@@ -533,8 +546,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 70: return Proc0(loops)
πF.SetLineno(70)
// line 71: return Proc0(loops)
πF.SetLineno(71)
πTemp001 = πF.MakeArgs(1)
if πE = πg.CheckLocal(πF, µloops, "loops"); πE != nil {
continue
......@@ -555,31 +568,31 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßpystones.ToObject(), πTemp003); πE != nil {
continue
}
// line 72: IntGlob = 0
πF.SetLineno(72)
// line 73: IntGlob = 0
πF.SetLineno(73)
if πE = πF.Globals().SetItem(πF, ßIntGlob.ToObject(), πg.NewInt(0).ToObject()); πE != nil {
continue
}
// line 73: BoolGlob = FALSE
πF.SetLineno(73)
// line 74: BoolGlob = FALSE
πF.SetLineno(74)
if πTemp004, πE = πg.ResolveGlobal(πF, ßFALSE); πE != nil {
continue
}
if πE = πF.Globals().SetItem(πF, ßBoolGlob.ToObject(), πTemp004); πE != nil {
continue
}
// line 74: Char1Glob = '\0'
πF.SetLineno(74)
// line 75: Char1Glob = '\0'
πF.SetLineno(75)
if πE = πF.Globals().SetItem(πF, ßChar1Glob.ToObject(), πg.NewStr("\x00").ToObject()); πE != nil {
continue
}
// line 75: Char2Glob = '\0'
πF.SetLineno(75)
// line 76: Char2Glob = '\0'
πF.SetLineno(76)
if πE = πF.Globals().SetItem(πF, ßChar2Glob.ToObject(), πg.NewStr("\x00").ToObject()); πE != nil {
continue
}
// line 76: Array1Glob = [0]*51
πF.SetLineno(76)
// line 77: Array1Glob = [0]*51
πF.SetLineno(77)
πTemp002 = make([]*πg.Object, 1)
πTemp002[0] = πg.NewInt(0).ToObject()
πTemp005 = πg.NewList(πTemp002...).ToObject()
......@@ -589,8 +602,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßArray1Glob.ToObject(), πTemp004); πE != nil {
continue
}
// line 77: Array2Glob = map(lambda x: x[:], [Array1Glob]*51)
πF.SetLineno(77)
// line 78: Array2Glob = map(lambda x: x[:], [Array1Glob]*51)
πF.SetLineno(78)
πTemp002 = πF.MakeArgs(2)
πTemp009 = make([]πg.Param, 1)
πTemp009[0] = πg.Param{Name: "x", Def: nil}
......@@ -606,8 +619,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 77: Array2Glob = map(lambda x: x[:], [Array1Glob]*51)
πF.SetLineno(77)
// line 78: Array2Glob = map(lambda x: x[:], [Array1Glob]*51)
πF.SetLineno(78)
if πTemp001, πE = πg.SliceType.Call(πF, πg.Args{πg.None, πg.None, πg.None}, nil); πE != nil {
continue
}
......@@ -643,24 +656,24 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßArray2Glob.ToObject(), πTemp005); πE != nil {
continue
}
// line 78: PtrGlb = None
πF.SetLineno(78)
// line 79: PtrGlb = None
πF.SetLineno(79)
if πTemp004, πE = πg.ResolveGlobal(πF, ßNone); πE != nil {
continue
}
if πE = πF.Globals().SetItem(πF, ßPtrGlb.ToObject(), πTemp004); πE != nil {
continue
}
// line 79: PtrGlbNext = None
πF.SetLineno(79)
// line 80: PtrGlbNext = None
πF.SetLineno(80)
if πTemp004, πE = πg.ResolveGlobal(πF, ßNone); πE != nil {
continue
}
if πE = πF.Globals().SetItem(πF, ßPtrGlbNext.ToObject(), πTemp004); πE != nil {
continue
}
// line 81: def Proc0(loops=LOOPS):
πF.SetLineno(81)
// line 82: def Proc0(loops=LOOPS):
πF.SetLineno(82)
πTemp009 = make([]πg.Param, 1)
if πTemp005, πE = πg.ResolveGlobal(πF, ßLOOPS); πE != nil {
continue
......@@ -708,24 +721,24 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 82: global IntGlob
πF.SetLineno(82)
// line 83: global BoolGlob
// line 83: global IntGlob
πF.SetLineno(83)
// line 84: global Char1Glob
// line 84: global BoolGlob
πF.SetLineno(84)
// line 85: global Char2Glob
// line 85: global Char1Glob
πF.SetLineno(85)
// line 86: global Array1Glob
// line 86: global Char2Glob
πF.SetLineno(86)
// line 87: global Array2Glob
// line 87: global Array1Glob
πF.SetLineno(87)
// line 88: global PtrGlb
// line 88: global Array2Glob
πF.SetLineno(88)
// line 89: global PtrGlbNext
// line 89: global PtrGlb
πF.SetLineno(89)
// line 91: starttime = clock()
πF.SetLineno(91)
// line 90: global PtrGlbNext
πF.SetLineno(90)
// line 92: starttime = clock()
πF.SetLineno(92)
if πTemp001, πE = πg.ResolveGlobal(πF, ßclock); πE != nil {
continue
}
......@@ -733,8 +746,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µstarttime = πTemp002
// line 92: for i in range(loops):
πF.SetLineno(92)
// line 93: for i in range(loops):
πF.SetLineno(93)
πTemp003 = πF.MakeArgs(1)
if πE = πg.CheckLocal(πF, µloops, "loops"); πE != nil {
continue
......@@ -765,13 +778,13 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label2
}
µi = πTemp004
// line 93: pass
πF.SetLineno(93)
// line 94: pass
πF.SetLineno(94)
goto Label1
goto Label2
Label2:
// line 94: nulltime = clock() - starttime
πF.SetLineno(94)
// line 95: nulltime = clock() - starttime
πF.SetLineno(95)
if πTemp002, πE = πg.ResolveGlobal(πF, ßclock); πE != nil {
continue
}
......@@ -785,8 +798,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µnulltime = πTemp001
// line 96: PtrGlbNext = Record()
πF.SetLineno(96)
// line 97: PtrGlbNext = Record()
πF.SetLineno(97)
if πTemp001, πE = πg.ResolveGlobal(πF, ßRecord); πE != nil {
continue
}
......@@ -796,8 +809,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßPtrGlbNext.ToObject(), πTemp002); πE != nil {
continue
}
// line 97: PtrGlb = Record()
πF.SetLineno(97)
// line 98: PtrGlb = Record()
πF.SetLineno(98)
if πTemp001, πE = πg.ResolveGlobal(πF, ßRecord); πE != nil {
continue
}
......@@ -807,8 +820,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßPtrGlb.ToObject(), πTemp002); πE != nil {
continue
}
// line 98: PtrGlb.PtrComp = PtrGlbNext
πF.SetLineno(98)
// line 99: PtrGlb.PtrComp = PtrGlbNext
πF.SetLineno(99)
if πTemp001, πE = πg.ResolveGlobal(πF, ßPtrGlbNext); πE != nil {
continue
}
......@@ -821,8 +834,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, πTemp004, ßPtrComp, πTemp002); πE != nil {
continue
}
// line 99: PtrGlb.Discr = Ident1
πF.SetLineno(99)
// line 100: PtrGlb.Discr = Ident1
πF.SetLineno(100)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent1); πE != nil {
continue
}
......@@ -835,8 +848,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, πTemp004, ßDiscr, πTemp002); πE != nil {
continue
}
// line 100: PtrGlb.EnumComp = Ident3
πF.SetLineno(100)
// line 101: PtrGlb.EnumComp = Ident3
πF.SetLineno(101)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent3); πE != nil {
continue
}
......@@ -849,8 +862,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, πTemp004, ßEnumComp, πTemp002); πE != nil {
continue
}
// line 101: PtrGlb.IntComp = 40
πF.SetLineno(101)
// line 102: PtrGlb.IntComp = 40
πF.SetLineno(102)
if πE = πg.Tie(πF, πg.TieTarget{Target: &πTemp001}, πg.NewInt(40).ToObject()); πE != nil {
continue
}
......@@ -860,8 +873,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, πTemp002, ßIntComp, πTemp001); πE != nil {
continue
}
// line 102: PtrGlb.StringComp = "DHRYSTONE PROGRAM, SOME STRING"
πF.SetLineno(102)
// line 103: PtrGlb.StringComp = "DHRYSTONE PROGRAM, SOME STRING"
πF.SetLineno(103)
if πE = πg.Tie(πF, πg.TieTarget{Target: &πTemp001}, πg.NewStr("DHRYSTONE PROGRAM, SOME STRING").ToObject()); πE != nil {
continue
}
......@@ -871,11 +884,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, πTemp002, ßStringComp, πTemp001); πE != nil {
continue
}
// line 103: String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING"
πF.SetLineno(103)
µString1Loc = πg.NewStr("DHRYSTONE PROGRAM, 1'ST STRING").ToObject()
// line 104: Array2Glob[8][7] = 10
// line 104: String1Loc = "DHRYSTONE PROGRAM, 1'ST STRING"
πF.SetLineno(104)
µString1Loc = πg.NewStr("DHRYSTONE PROGRAM, 1'ST STRING").ToObject()
// line 105: Array2Glob[8][7] = 10
πF.SetLineno(105)
if πE = πg.Tie(πF, πg.TieTarget{Target: &πTemp001}, πg.NewInt(10).ToObject()); πE != nil {
continue
}
......@@ -890,8 +903,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetItem(πF, πTemp004, πTemp002, πTemp001); πE != nil {
continue
}
// line 106: starttime = clock()
πF.SetLineno(106)
// line 107: starttime = clock()
πF.SetLineno(107)
if πTemp001, πE = πg.ResolveGlobal(πF, ßclock); πE != nil {
continue
}
......@@ -899,8 +912,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µstarttime = πTemp002
// line 108: for i in range(loops):
πF.SetLineno(108)
// line 109: for i in range(loops):
πF.SetLineno(109)
πTemp003 = πF.MakeArgs(1)
if πE = πg.CheckLocal(πF, µloops, "loops"); πE != nil {
continue
......@@ -931,39 +944,39 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label4
}
µi = πTemp004
// line 109: Proc5()
πF.SetLineno(109)
// line 110: Proc5()
πF.SetLineno(110)
if πTemp005, πE = πg.ResolveGlobal(πF, ßProc5); πE != nil {
continue
}
if πTemp006, πE = πTemp005.Call(πF, nil, nil); πE != nil {
continue
}
// line 110: Proc4()
πF.SetLineno(110)
// line 111: Proc4()
πF.SetLineno(111)
if πTemp005, πE = πg.ResolveGlobal(πF, ßProc4); πE != nil {
continue
}
if πTemp006, πE = πTemp005.Call(πF, nil, nil); πE != nil {
continue
}
// line 111: IntLoc1 = 2
πF.SetLineno(111)
µIntLoc1 = πg.NewInt(2).ToObject()
// line 112: IntLoc2 = 3
// line 112: IntLoc1 = 2
πF.SetLineno(112)
µIntLoc2 = πg.NewInt(3).ToObject()
// line 113: String2Loc = "DHRYSTONE PROGRAM, 2'ND STRING"
µIntLoc1 = πg.NewInt(2).ToObject()
// line 113: IntLoc2 = 3
πF.SetLineno(113)
µString2Loc = πg.NewStr("DHRYSTONE PROGRAM, 2'ND STRING").ToObject()
// line 114: EnumLoc = Ident2
µIntLoc2 = πg.NewInt(3).ToObject()
// line 114: String2Loc = "DHRYSTONE PROGRAM, 2'ND STRING"
πF.SetLineno(114)
µString2Loc = πg.NewStr("DHRYSTONE PROGRAM, 2'ND STRING").ToObject()
// line 115: EnumLoc = Ident2
πF.SetLineno(115)
if πTemp005, πE = πg.ResolveGlobal(πF, ßIdent2); πE != nil {
continue
}
µEnumLoc = πTemp005
// line 115: BoolGlob = not Func2(String1Loc, String2Loc)
πF.SetLineno(115)
// line 116: BoolGlob = not Func2(String1Loc, String2Loc)
πF.SetLineno(116)
πTemp003 = πF.MakeArgs(2)
if πE = πg.CheckLocal(πF, µString1Loc, "String1Loc"); πE != nil {
continue
......@@ -987,8 +1000,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßBoolGlob.ToObject(), πTemp005); πE != nil {
continue
}
// line 116: while IntLoc1 < IntLoc2:
πF.SetLineno(116)
// line 117: while IntLoc1 < IntLoc2:
πF.SetLineno(117)
Label5:
if πE = πg.CheckLocal(πF, µIntLoc1, "IntLoc1"); πE != nil {
continue
......@@ -1005,8 +1018,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if !πTemp008 {
goto Label6
}
// line 117: IntLoc3 = 5 * IntLoc1 - IntLoc2
πF.SetLineno(117)
// line 118: IntLoc3 = 5 * IntLoc1 - IntLoc2
πF.SetLineno(118)
if πE = πg.CheckLocal(πF, µIntLoc1, "IntLoc1"); πE != nil {
continue
}
......@@ -1020,8 +1033,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntLoc3 = πTemp006
// line 118: IntLoc3 = Proc7(IntLoc1, IntLoc2)
πF.SetLineno(118)
// line 119: IntLoc3 = Proc7(IntLoc1, IntLoc2)
πF.SetLineno(119)
πTemp003 = πF.MakeArgs(2)
if πE = πg.CheckLocal(πF, µIntLoc1, "IntLoc1"); πE != nil {
continue
......@@ -1039,8 +1052,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
}
πF.FreeArgs(πTemp003)
µIntLoc3 = πTemp007
// line 119: IntLoc1 = IntLoc1 + 1
πF.SetLineno(119)
// line 120: IntLoc1 = IntLoc1 + 1
πF.SetLineno(120)
if πE = πg.CheckLocal(πF, µIntLoc1, "IntLoc1"); πE != nil {
continue
}
......@@ -1051,8 +1064,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label5
goto Label6
Label6:
// line 120: Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3)
πF.SetLineno(120)
// line 121: Proc8(Array1Glob, Array2Glob, IntLoc1, IntLoc3)
πF.SetLineno(121)
πTemp003 = πF.MakeArgs(4)
if πTemp005, πE = πg.ResolveGlobal(πF, ßArray1Glob); πE != nil {
continue
......@@ -1077,8 +1090,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
πF.FreeArgs(πTemp003)
// line 121: PtrGlb = Proc1(PtrGlb)
πF.SetLineno(121)
// line 122: PtrGlb = Proc1(PtrGlb)
πF.SetLineno(122)
πTemp003 = πF.MakeArgs(1)
if πTemp005, πE = πg.ResolveGlobal(πF, ßPtrGlb); πE != nil {
continue
......@@ -1094,11 +1107,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßPtrGlb.ToObject(), πTemp006); πE != nil {
continue
}
// line 122: CharIndex = 'A'
πF.SetLineno(122)
µCharIndex = ßA.ToObject()
// line 123: while CharIndex <= Char2Glob:
// line 123: CharIndex = 'A'
πF.SetLineno(123)
µCharIndex = ßA.ToObject()
// line 124: while CharIndex <= Char2Glob:
πF.SetLineno(124)
Label7:
if πE = πg.CheckLocal(πF, µCharIndex, "CharIndex"); πE != nil {
continue
......@@ -1141,11 +1154,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label9
}
goto Label10
// line 124: if EnumLoc == Func1(CharIndex, 'C'):
πF.SetLineno(124)
Label9:
// line 125: EnumLoc = Proc6(Ident1)
// line 125: if EnumLoc == Func1(CharIndex, 'C'):
πF.SetLineno(125)
Label9:
// line 126: EnumLoc = Proc6(Ident1)
πF.SetLineno(126)
πTemp003 = πF.MakeArgs(1)
if πTemp006, πE = πg.ResolveGlobal(πF, ßIdent1); πE != nil {
continue
......@@ -1161,8 +1174,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
µEnumLoc = πTemp007
goto Label10
Label10:
// line 126: CharIndex = chr(ord(CharIndex)+1)
πF.SetLineno(126)
// line 127: CharIndex = chr(ord(CharIndex)+1)
πF.SetLineno(127)
πTemp003 = πF.MakeArgs(1)
πTemp011 = πF.MakeArgs(1)
if πE = πg.CheckLocal(πF, µCharIndex, "CharIndex"); πE != nil {
......@@ -1191,8 +1204,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label7
goto Label8
Label8:
// line 127: IntLoc3 = IntLoc2 * IntLoc1
πF.SetLineno(127)
// line 128: IntLoc3 = IntLoc2 * IntLoc1
πF.SetLineno(128)
if πE = πg.CheckLocal(πF, µIntLoc2, "IntLoc2"); πE != nil {
continue
}
......@@ -1203,8 +1216,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntLoc3 = πTemp005
// line 128: IntLoc2 = IntLoc3 / IntLoc1
πF.SetLineno(128)
// line 129: IntLoc2 = IntLoc3 / IntLoc1
πF.SetLineno(129)
if πE = πg.CheckLocal(πF, µIntLoc3, "IntLoc3"); πE != nil {
continue
}
......@@ -1215,8 +1228,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntLoc2 = πTemp005
// line 129: IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1
πF.SetLineno(129)
// line 130: IntLoc2 = 7 * (IntLoc3 - IntLoc2) - IntLoc1
πF.SetLineno(130)
if πE = πg.CheckLocal(πF, µIntLoc3, "IntLoc3"); πE != nil {
continue
}
......@@ -1236,8 +1249,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntLoc2 = πTemp005
// line 130: IntLoc1 = Proc2(IntLoc1)
πF.SetLineno(130)
// line 131: IntLoc1 = Proc2(IntLoc1)
πF.SetLineno(131)
πTemp003 = πF.MakeArgs(1)
if πE = πg.CheckLocal(πF, µIntLoc1, "IntLoc1"); πE != nil {
continue
......@@ -1254,8 +1267,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label3
goto Label4
Label4:
// line 132: benchtime = clock() - starttime - nulltime
πF.SetLineno(132)
// line 133: benchtime = clock() - starttime - nulltime
πF.SetLineno(133)
if πTemp004, πE = πg.ResolveGlobal(πF, ßclock); πE != nil {
continue
}
......@@ -1288,16 +1301,16 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label11
}
goto Label12
// line 133: if benchtime == 0.0:
πF.SetLineno(133)
Label11:
// line 134: loopsPerBenchtime = 0.0
// line 134: if benchtime == 0.0:
πF.SetLineno(134)
Label11:
// line 135: loopsPerBenchtime = 0.0
πF.SetLineno(135)
µloopsPerBenchtime = πg.NewFloat(0.0).ToObject()
goto Label13
Label12:
// line 136: loopsPerBenchtime = (loops / benchtime)
πF.SetLineno(136)
// line 137: loopsPerBenchtime = (loops / benchtime)
πF.SetLineno(137)
if πE = πg.CheckLocal(πF, µloops, "loops"); πE != nil {
continue
}
......@@ -1310,8 +1323,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
µloopsPerBenchtime = πTemp001
goto Label13
Label13:
// line 137: return benchtime, loopsPerBenchtime
πF.SetLineno(137)
// line 138: return benchtime, loopsPerBenchtime
πF.SetLineno(138)
if πE = πg.CheckLocal(πF, µbenchtime, "benchtime"); πE != nil {
continue
}
......@@ -1327,8 +1340,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßProc0.ToObject(), πTemp004); πE != nil {
continue
}
// line 139: def Proc1(PtrParIn):
πF.SetLineno(139)
// line 140: def Proc1(PtrParIn):
πF.SetLineno(140)
πTemp009 = make([]πg.Param, 1)
πTemp009[0] = πg.Param{Name: "PtrParIn", Def: nil}
πTemp005 = πg.NewFunction(πg.NewCode("Proc1", "pystone.py", πTemp009, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
......@@ -1350,8 +1363,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 140: PtrParIn.PtrComp = NextRecord = PtrGlb.copy()
πF.SetLineno(140)
// line 141: PtrParIn.PtrComp = NextRecord = PtrGlb.copy()
πF.SetLineno(141)
if πTemp001, πE = πg.ResolveGlobal(πF, ßPtrGlb); πE != nil {
continue
}
......@@ -1371,8 +1384,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µNextRecord = πTemp001
// line 141: PtrParIn.IntComp = 5
πF.SetLineno(141)
// line 142: PtrParIn.IntComp = 5
πF.SetLineno(142)
if πE = πg.Tie(πF, πg.TieTarget{Target: &πTemp001}, πg.NewInt(5).ToObject()); πE != nil {
continue
}
......@@ -1382,8 +1395,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µPtrParIn, ßIntComp, πTemp001); πE != nil {
continue
}
// line 142: NextRecord.IntComp = PtrParIn.IntComp
πF.SetLineno(142)
// line 143: NextRecord.IntComp = PtrParIn.IntComp
πF.SetLineno(143)
if πE = πg.CheckLocal(πF, µPtrParIn, "PtrParIn"); πE != nil {
continue
}
......@@ -1399,8 +1412,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µNextRecord, ßIntComp, πTemp002); πE != nil {
continue
}
// line 143: NextRecord.PtrComp = PtrParIn.PtrComp
πF.SetLineno(143)
// line 144: NextRecord.PtrComp = PtrParIn.PtrComp
πF.SetLineno(144)
if πE = πg.CheckLocal(πF, µPtrParIn, "PtrParIn"); πE != nil {
continue
}
......@@ -1416,8 +1429,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µNextRecord, ßPtrComp, πTemp002); πE != nil {
continue
}
// line 144: NextRecord.PtrComp = Proc3(NextRecord.PtrComp)
πF.SetLineno(144)
// line 145: NextRecord.PtrComp = Proc3(NextRecord.PtrComp)
πF.SetLineno(145)
πTemp003 = πF.MakeArgs(1)
if πE = πg.CheckLocal(πF, µNextRecord, "NextRecord"); πE != nil {
continue
......@@ -1461,11 +1474,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label1
}
goto Label2
// line 145: if NextRecord.Discr == Ident1:
πF.SetLineno(145)
Label1:
// line 146: NextRecord.IntComp = 6
// line 146: if NextRecord.Discr == Ident1:
πF.SetLineno(146)
Label1:
// line 147: NextRecord.IntComp = 6
πF.SetLineno(147)
if πE = πg.Tie(πF, πg.TieTarget{Target: &πTemp001}, πg.NewInt(6).ToObject()); πE != nil {
continue
}
......@@ -1475,8 +1488,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µNextRecord, ßIntComp, πTemp001); πE != nil {
continue
}
// line 147: NextRecord.EnumComp = Proc6(PtrParIn.EnumComp)
πF.SetLineno(147)
// line 148: NextRecord.EnumComp = Proc6(PtrParIn.EnumComp)
πF.SetLineno(148)
πTemp003 = πF.MakeArgs(1)
if πE = πg.CheckLocal(πF, µPtrParIn, "PtrParIn"); πE != nil {
continue
......@@ -1501,8 +1514,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µNextRecord, ßEnumComp, πTemp001); πE != nil {
continue
}
// line 148: NextRecord.PtrComp = PtrGlb.PtrComp
πF.SetLineno(148)
// line 149: NextRecord.PtrComp = PtrGlb.PtrComp
πF.SetLineno(149)
if πTemp001, πE = πg.ResolveGlobal(πF, ßPtrGlb); πE != nil {
continue
}
......@@ -1518,8 +1531,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µNextRecord, ßPtrComp, πTemp001); πE != nil {
continue
}
// line 149: NextRecord.IntComp = Proc7(NextRecord.IntComp, 10)
πF.SetLineno(149)
// line 150: NextRecord.IntComp = Proc7(NextRecord.IntComp, 10)
πF.SetLineno(150)
πTemp003 = πF.MakeArgs(2)
if πE = πg.CheckLocal(πF, µNextRecord, "NextRecord"); πE != nil {
continue
......@@ -1547,8 +1560,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
}
goto Label3
Label2:
// line 151: PtrParIn = NextRecord.copy()
πF.SetLineno(151)
// line 152: PtrParIn = NextRecord.copy()
πF.SetLineno(152)
if πE = πg.CheckLocal(πF, µNextRecord, "NextRecord"); πE != nil {
continue
}
......@@ -1561,8 +1574,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
µPtrParIn = πTemp002
goto Label3
Label3:
// line 152: NextRecord.PtrComp = None
πF.SetLineno(152)
// line 153: NextRecord.PtrComp = None
πF.SetLineno(153)
if πTemp001, πE = πg.ResolveGlobal(πF, ßNone); πE != nil {
continue
}
......@@ -1575,8 +1588,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, µNextRecord, ßPtrComp, πTemp002); πE != nil {
continue
}
// line 153: return PtrParIn
πF.SetLineno(153)
// line 154: return PtrParIn
πF.SetLineno(154)
if πE = πg.CheckLocal(πF, µPtrParIn, "PtrParIn"); πE != nil {
continue
}
......@@ -1588,8 +1601,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßProc1.ToObject(), πTemp005); πE != nil {
continue
}
// line 155: def Proc2(IntParIO):
πF.SetLineno(155)
// line 156: def Proc2(IntParIO):
πF.SetLineno(156)
πTemp009 = make([]πg.Param, 1)
πTemp009[0] = πg.Param{Name: "IntParIO", Def: nil}
πTemp006 = πg.NewFunction(πg.NewCode("Proc2", "pystone.py", πTemp009, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
......@@ -1610,8 +1623,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 156: IntLoc = IntParIO + 10
πF.SetLineno(156)
// line 157: IntLoc = IntParIO + 10
πF.SetLineno(157)
if πE = πg.CheckLocal(πF, µIntParIO, "IntParIO"); πE != nil {
continue
}
......@@ -1619,8 +1632,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntLoc = πTemp001
// line 157: while 1:
πF.SetLineno(157)
// line 158: while 1:
πF.SetLineno(158)
Label1:
if πTemp002, πE = πg.IsTrue(πF, πg.NewInt(1).ToObject()); πE != nil {
continue
......@@ -1641,11 +1654,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label3
}
goto Label4
// line 158: if Char1Glob == 'A':
πF.SetLineno(158)
Label3:
// line 159: IntLoc = IntLoc - 1
// line 159: if Char1Glob == 'A':
πF.SetLineno(159)
Label3:
// line 160: IntLoc = IntLoc - 1
πF.SetLineno(160)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
}
......@@ -1653,8 +1666,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntLoc = πTemp001
// line 160: IntParIO = IntLoc - IntGlob
πF.SetLineno(160)
// line 161: IntParIO = IntLoc - IntGlob
πF.SetLineno(161)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
}
......@@ -1665,8 +1678,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntParIO = πTemp001
// line 161: EnumLoc = Ident1
πF.SetLineno(161)
// line 162: EnumLoc = Ident1
πF.SetLineno(162)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent1); πE != nil {
continue
}
......@@ -1689,19 +1702,19 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label5
}
goto Label6
// line 162: if EnumLoc == Ident1:
πF.SetLineno(162)
Label5:
// line 163: break
// line 163: if EnumLoc == Ident1:
πF.SetLineno(163)
Label5:
// line 164: break
πF.SetLineno(164)
goto Label2
goto Label6
Label6:
goto Label1
goto Label2
Label2:
// line 164: return IntParIO
πF.SetLineno(164)
// line 165: return IntParIO
πF.SetLineno(165)
if πE = πg.CheckLocal(πF, µIntParIO, "IntParIO"); πE != nil {
continue
}
......@@ -1713,8 +1726,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßProc2.ToObject(), πTemp006); πE != nil {
continue
}
// line 166: def Proc3(PtrParOut):
πF.SetLineno(166)
// line 167: def Proc3(PtrParOut):
πF.SetLineno(167)
πTemp009 = make([]πg.Param, 1)
πTemp009[0] = πg.Param{Name: "PtrParOut", Def: nil}
πTemp007 = πg.NewFunction(πg.NewCode("Proc3", "pystone.py", πTemp009, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
......@@ -1735,8 +1748,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 167: global IntGlob
πF.SetLineno(167)
// line 168: global IntGlob
πF.SetLineno(168)
if πTemp002, πE = πg.ResolveGlobal(πF, ßPtrGlb); πE != nil {
continue
}
......@@ -1751,11 +1764,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label1
}
goto Label2
// line 169: if PtrGlb is not None:
πF.SetLineno(169)
Label1:
// line 170: PtrParOut = PtrGlb.PtrComp
// line 170: if PtrGlb is not None:
πF.SetLineno(170)
Label1:
// line 171: PtrParOut = PtrGlb.PtrComp
πF.SetLineno(171)
if πTemp001, πE = πg.ResolveGlobal(πF, ßPtrGlb); πE != nil {
continue
}
......@@ -1765,15 +1778,15 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
µPtrParOut = πTemp002
goto Label3
Label2:
// line 172: IntGlob = 100
πF.SetLineno(172)
// line 173: IntGlob = 100
πF.SetLineno(173)
if πE = πF.Globals().SetItem(πF, ßIntGlob.ToObject(), πg.NewInt(100).ToObject()); πE != nil {
continue
}
goto Label3
Label3:
// line 173: PtrGlb.IntComp = Proc7(10, IntGlob)
πF.SetLineno(173)
// line 174: PtrGlb.IntComp = Proc7(10, IntGlob)
πF.SetLineno(174)
πTemp005 = πF.MakeArgs(2)
πTemp005[0] = πg.NewInt(10).ToObject()
if πTemp001, πE = πg.ResolveGlobal(πF, ßIntGlob); πE != nil {
......@@ -1796,8 +1809,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetAttr(πF, πTemp003, ßIntComp, πTemp001); πE != nil {
continue
}
// line 174: return PtrParOut
πF.SetLineno(174)
// line 175: return PtrParOut
πF.SetLineno(175)
if πE = πg.CheckLocal(πF, µPtrParOut, "PtrParOut"); πE != nil {
continue
}
......@@ -1809,8 +1822,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßProc3.ToObject(), πTemp007); πE != nil {
continue
}
// line 176: def Proc4():
πF.SetLineno(176)
// line 177: def Proc4():
πF.SetLineno(177)
πTemp009 = make([]πg.Param, 0)
πTemp011 = πg.NewFunction(πg.NewCode("Proc4", "pystone.py", πTemp009, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
var µBoolLoc *πg.Object = πg.UnboundLocal; _ = µBoolLoc
......@@ -1826,10 +1839,10 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 177: global Char2Glob
πF.SetLineno(177)
// line 179: BoolLoc = Char1Glob == 'A'
πF.SetLineno(179)
// line 178: global Char2Glob
πF.SetLineno(178)
// line 180: BoolLoc = Char1Glob == 'A'
πF.SetLineno(180)
if πTemp002, πE = πg.ResolveGlobal(πF, ßChar1Glob); πE != nil {
continue
}
......@@ -1837,8 +1850,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µBoolLoc = πTemp001
// line 180: BoolLoc = BoolLoc or BoolGlob
πF.SetLineno(180)
// line 181: BoolLoc = BoolLoc or BoolGlob
πF.SetLineno(181)
if πE = πg.CheckLocal(πF, µBoolLoc, "BoolLoc"); πE != nil {
continue
}
......@@ -1855,8 +1868,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
πTemp001 = πTemp002
Label1:
µBoolLoc = πTemp001
// line 181: Char2Glob = 'B'
πF.SetLineno(181)
// line 182: Char2Glob = 'B'
πF.SetLineno(182)
if πE = πF.Globals().SetItem(πF, ßChar2Glob.ToObject(), ßB.ToObject()); πE != nil {
continue
}
......@@ -1867,8 +1880,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßProc4.ToObject(), πTemp011); πE != nil {
continue
}
// line 183: def Proc5():
πF.SetLineno(183)
// line 184: def Proc5():
πF.SetLineno(184)
πTemp009 = make([]πg.Param, 0)
πTemp012 = πg.NewFunction(πg.NewCode("Proc5", "pystone.py", πTemp009, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
var πTemp001 *πg.Object
......@@ -1879,17 +1892,17 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 184: global Char1Glob
πF.SetLineno(184)
// line 185: global BoolGlob
// line 185: global Char1Glob
πF.SetLineno(185)
// line 187: Char1Glob = 'A'
πF.SetLineno(187)
// line 186: global BoolGlob
πF.SetLineno(186)
// line 188: Char1Glob = 'A'
πF.SetLineno(188)
if πE = πF.Globals().SetItem(πF, ßChar1Glob.ToObject(), ßA.ToObject()); πE != nil {
continue
}
// line 188: BoolGlob = FALSE
πF.SetLineno(188)
// line 189: BoolGlob = FALSE
πF.SetLineno(189)
if πTemp001, πE = πg.ResolveGlobal(πF, ßFALSE); πE != nil {
continue
}
......@@ -1903,8 +1916,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßProc5.ToObject(), πTemp012); πE != nil {
continue
}
// line 190: def Proc6(EnumParIn):
πF.SetLineno(190)
// line 191: def Proc6(EnumParIn):
πF.SetLineno(191)
πTemp009 = make([]πg.Param, 1)
πTemp009[0] = πg.Param{Name: "EnumParIn", Def: nil}
πTemp013 = πg.NewFunction(πg.NewCode("Proc6", "pystone.py", πTemp009, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
......@@ -1926,8 +1939,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 191: EnumParOut = EnumParIn
πF.SetLineno(191)
// line 192: EnumParOut = EnumParIn
πF.SetLineno(192)
if πE = πg.CheckLocal(πF, µEnumParIn, "EnumParIn"); πE != nil {
continue
}
......@@ -1955,11 +1968,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label1
}
goto Label2
// line 192: if not Func3(EnumParIn):
πF.SetLineno(192)
Label1:
// line 193: EnumParOut = Ident4
// line 193: if not Func3(EnumParIn):
πF.SetLineno(193)
Label1:
// line 194: EnumParOut = Ident4
πF.SetLineno(194)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent4); πE != nil {
continue
}
......@@ -2042,18 +2055,18 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label7
}
goto Label8
// line 194: if EnumParIn == Ident1:
πF.SetLineno(194)
Label3:
// line 195: EnumParOut = Ident1
// line 195: if EnumParIn == Ident1:
πF.SetLineno(195)
Label3:
// line 196: EnumParOut = Ident1
πF.SetLineno(196)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent1); πE != nil {
continue
}
µEnumParOut = πTemp001
goto Label8
// line 196: elif EnumParIn == Ident2:
πF.SetLineno(196)
// line 197: elif EnumParIn == Ident2:
πF.SetLineno(197)
Label4:
if πTemp003, πE = πg.ResolveGlobal(πF, ßIntGlob); πE != nil {
continue
......@@ -2068,19 +2081,19 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label9
}
goto Label10
// line 197: if IntGlob > 100:
πF.SetLineno(197)
Label9:
// line 198: EnumParOut = Ident1
// line 198: if IntGlob > 100:
πF.SetLineno(198)
Label9:
// line 199: EnumParOut = Ident1
πF.SetLineno(199)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent1); πE != nil {
continue
}
µEnumParOut = πTemp001
goto Label11
Label10:
// line 200: EnumParOut = Ident4
πF.SetLineno(200)
// line 201: EnumParOut = Ident4
πF.SetLineno(201)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent4); πE != nil {
continue
}
......@@ -2088,35 +2101,35 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label11
Label11:
goto Label8
// line 201: elif EnumParIn == Ident3:
πF.SetLineno(201)
Label5:
// line 202: EnumParOut = Ident2
// line 202: elif EnumParIn == Ident3:
πF.SetLineno(202)
Label5:
// line 203: EnumParOut = Ident2
πF.SetLineno(203)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent2); πE != nil {
continue
}
µEnumParOut = πTemp001
goto Label8
// line 203: elif EnumParIn == Ident4:
πF.SetLineno(203)
Label6:
// line 204: pass
// line 204: elif EnumParIn == Ident4:
πF.SetLineno(204)
goto Label8
// line 205: elif EnumParIn == Ident5:
Label6:
// line 205: pass
πF.SetLineno(205)
Label7:
// line 206: EnumParOut = Ident3
goto Label8
// line 206: elif EnumParIn == Ident5:
πF.SetLineno(206)
Label7:
// line 207: EnumParOut = Ident3
πF.SetLineno(207)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent3); πE != nil {
continue
}
µEnumParOut = πTemp001
goto Label8
Label8:
// line 207: return EnumParOut
πF.SetLineno(207)
// line 208: return EnumParOut
πF.SetLineno(208)
if πE = πg.CheckLocal(πF, µEnumParOut, "EnumParOut"); πE != nil {
continue
}
......@@ -2128,8 +2141,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßProc6.ToObject(), πTemp013); πE != nil {
continue
}
// line 209: def Proc7(IntParI1, IntParI2):
πF.SetLineno(209)
// line 210: def Proc7(IntParI1, IntParI2):
πF.SetLineno(210)
πTemp009 = make([]πg.Param, 2)
πTemp009[0] = πg.Param{Name: "IntParI1", Def: nil}
πTemp009[1] = πg.Param{Name: "IntParI2", Def: nil}
......@@ -2146,8 +2159,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 210: IntLoc = IntParI1 + 2
πF.SetLineno(210)
// line 211: IntLoc = IntParI1 + 2
πF.SetLineno(211)
if πE = πg.CheckLocal(πF, µIntParI1, "IntParI1"); πE != nil {
continue
}
......@@ -2155,8 +2168,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntLoc = πTemp001
// line 211: IntParOut = IntParI2 + IntLoc
πF.SetLineno(211)
// line 212: IntParOut = IntParI2 + IntLoc
πF.SetLineno(212)
if πE = πg.CheckLocal(πF, µIntParI2, "IntParI2"); πE != nil {
continue
}
......@@ -2167,8 +2180,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntParOut = πTemp001
// line 212: return IntParOut
πF.SetLineno(212)
// line 213: return IntParOut
πF.SetLineno(213)
if πE = πg.CheckLocal(πF, µIntParOut, "IntParOut"); πE != nil {
continue
}
......@@ -2180,8 +2193,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßProc7.ToObject(), πTemp014); πE != nil {
continue
}
// line 214: def Proc8(Array1Par, Array2Par, IntParI1, IntParI2):
πF.SetLineno(214)
// line 215: def Proc8(Array1Par, Array2Par, IntParI1, IntParI2):
πF.SetLineno(215)
πTemp009 = make([]πg.Param, 4)
πTemp009[0] = πg.Param{Name: "Array1Par", Def: nil}
πTemp009[1] = πg.Param{Name: "Array2Par", Def: nil}
......@@ -2214,10 +2227,10 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 215: global IntGlob
πF.SetLineno(215)
// line 217: IntLoc = IntParI1 + 5
πF.SetLineno(217)
// line 216: global IntGlob
πF.SetLineno(216)
// line 218: IntLoc = IntParI1 + 5
πF.SetLineno(218)
if πE = πg.CheckLocal(πF, µIntParI1, "IntParI1"); πE != nil {
continue
}
......@@ -2225,8 +2238,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntLoc = πTemp001
// line 218: Array1Par[IntLoc] = IntParI2
πF.SetLineno(218)
// line 219: Array1Par[IntLoc] = IntParI2
πF.SetLineno(219)
if πE = πg.CheckLocal(πF, µIntParI2, "IntParI2"); πE != nil {
continue
}
......@@ -2243,8 +2256,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetItem(πF, µArray1Par, πTemp002, πTemp001); πE != nil {
continue
}
// line 219: Array1Par[IntLoc+1] = Array1Par[IntLoc]
πF.SetLineno(219)
// line 220: Array1Par[IntLoc+1] = Array1Par[IntLoc]
πF.SetLineno(220)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
}
......@@ -2271,8 +2284,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetItem(πF, µArray1Par, πTemp003, πTemp001); πE != nil {
continue
}
// line 220: Array1Par[IntLoc+30] = IntLoc
πF.SetLineno(220)
// line 221: Array1Par[IntLoc+30] = IntLoc
πF.SetLineno(221)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
}
......@@ -2292,8 +2305,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetItem(πF, µArray1Par, πTemp002, πTemp001); πE != nil {
continue
}
// line 221: for IntIndex in range(IntLoc, IntLoc+2):
πF.SetLineno(221)
// line 222: for IntIndex in range(IntLoc, IntLoc+2):
πF.SetLineno(222)
πTemp005 = πF.MakeArgs(2)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
......@@ -2331,8 +2344,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label2
}
µIntIndex = πTemp003
// line 222: Array2Par[IntLoc][IntIndex] = IntLoc
πF.SetLineno(222)
// line 223: Array2Par[IntLoc][IntIndex] = IntLoc
πF.SetLineno(223)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
}
......@@ -2359,8 +2372,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label1
goto Label2
Label2:
// line 223: Array2Par[IntLoc][IntLoc-1] = Array2Par[IntLoc][IntLoc-1] + 1
πF.SetLineno(223)
// line 224: Array2Par[IntLoc][IntLoc-1] = Array2Par[IntLoc][IntLoc-1] + 1
πF.SetLineno(224)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
}
......@@ -2407,8 +2420,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetItem(πF, πTemp004, πTemp003, πTemp002); πE != nil {
continue
}
// line 224: Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc]
πF.SetLineno(224)
// line 225: Array2Par[IntLoc+20][IntLoc] = Array1Par[IntLoc]
πF.SetLineno(225)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
}
......@@ -2442,8 +2455,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.SetItem(πF, πTemp004, πTemp003, πTemp001); πE != nil {
continue
}
// line 225: IntGlob = 5
πF.SetLineno(225)
// line 226: IntGlob = 5
πF.SetLineno(226)
if πE = πF.Globals().SetItem(πF, ßIntGlob.ToObject(), πg.NewInt(5).ToObject()); πE != nil {
continue
}
......@@ -2454,8 +2467,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßProc8.ToObject(), πTemp015); πE != nil {
continue
}
// line 227: def Func1(CharPar1, CharPar2):
πF.SetLineno(227)
// line 228: def Func1(CharPar1, CharPar2):
πF.SetLineno(228)
πTemp009 = make([]πg.Param, 2)
πTemp009[0] = πg.Param{Name: "CharPar1", Def: nil}
πTemp009[1] = πg.Param{Name: "CharPar2", Def: nil}
......@@ -2474,14 +2487,14 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 228: CharLoc1 = CharPar1
πF.SetLineno(228)
// line 229: CharLoc1 = CharPar1
πF.SetLineno(229)
if πE = πg.CheckLocal(πF, µCharPar1, "CharPar1"); πE != nil {
continue
}
µCharLoc1 = µCharPar1
// line 229: CharLoc2 = CharLoc1
πF.SetLineno(229)
// line 230: CharLoc2 = CharLoc1
πF.SetLineno(230)
if πE = πg.CheckLocal(πF, µCharLoc1, "CharLoc1"); πE != nil {
continue
}
......@@ -2502,19 +2515,19 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label1
}
goto Label2
// line 230: if CharLoc2 != CharPar2:
πF.SetLineno(230)
Label1:
// line 231: return Ident1
// line 231: if CharLoc2 != CharPar2:
πF.SetLineno(231)
Label1:
// line 232: return Ident1
πF.SetLineno(232)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent1); πE != nil {
continue
}
return πTemp001, nil
goto Label3
Label2:
// line 233: return Ident2
πF.SetLineno(233)
// line 234: return Ident2
πF.SetLineno(234)
if πTemp001, πE = πg.ResolveGlobal(πF, ßIdent2); πE != nil {
continue
}
......@@ -2528,8 +2541,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßFunc1.ToObject(), πTemp016); πE != nil {
continue
}
// line 235: def Func2(StrParI1, StrParI2):
πF.SetLineno(235)
// line 236: def Func2(StrParI1, StrParI2):
πF.SetLineno(236)
πTemp009 = make([]πg.Param, 2)
πTemp009[0] = πg.Param{Name: "StrParI1", Def: nil}
πTemp009[1] = πg.Param{Name: "StrParI2", Def: nil}
......@@ -2558,11 +2571,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 236: IntLoc = 1
πF.SetLineno(236)
µIntLoc = πg.NewInt(1).ToObject()
// line 237: while IntLoc <= 1:
// line 237: IntLoc = 1
πF.SetLineno(237)
µIntLoc = πg.NewInt(1).ToObject()
// line 238: while IntLoc <= 1:
πF.SetLineno(238)
Label1:
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
......@@ -2622,14 +2635,14 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label3
}
goto Label4
// line 238: if Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1:
πF.SetLineno(238)
Label3:
// line 239: CharLoc = 'A'
// line 239: if Func1(StrParI1[IntLoc], StrParI2[IntLoc+1]) == Ident1:
πF.SetLineno(239)
µCharLoc = ßA.ToObject()
// line 240: IntLoc = IntLoc + 1
Label3:
// line 240: CharLoc = 'A'
πF.SetLineno(240)
µCharLoc = ßA.ToObject()
// line 241: IntLoc = IntLoc + 1
πF.SetLineno(241)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
}
......@@ -2670,11 +2683,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label6
}
goto Label7
// line 241: if CharLoc >= 'W' and CharLoc <= 'Z':
πF.SetLineno(241)
Label6:
// line 242: IntLoc = 7
// line 242: if CharLoc >= 'W' and CharLoc <= 'Z':
πF.SetLineno(242)
Label6:
// line 243: IntLoc = 7
πF.SetLineno(243)
µIntLoc = πg.NewInt(7).ToObject()
goto Label7
Label7:
......@@ -2706,21 +2719,21 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label9
}
goto Label10
// line 243: if CharLoc == 'X':
πF.SetLineno(243)
Label8:
// line 244: return TRUE
// line 244: if CharLoc == 'X':
πF.SetLineno(244)
Label8:
// line 245: return TRUE
πF.SetLineno(245)
if πTemp001, πE = πg.ResolveGlobal(πF, ßTRUE); πE != nil {
continue
}
return πTemp001, nil
goto Label11
// line 246: if StrParI1 > StrParI2:
πF.SetLineno(246)
Label9:
// line 247: IntLoc = IntLoc + 7
// line 247: if StrParI1 > StrParI2:
πF.SetLineno(247)
Label9:
// line 248: IntLoc = IntLoc + 7
πF.SetLineno(248)
if πE = πg.CheckLocal(πF, µIntLoc, "IntLoc"); πE != nil {
continue
}
......@@ -2728,16 +2741,16 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
µIntLoc = πTemp001
// line 248: return TRUE
πF.SetLineno(248)
// line 249: return TRUE
πF.SetLineno(249)
if πTemp001, πE = πg.ResolveGlobal(πF, ßTRUE); πE != nil {
continue
}
return πTemp001, nil
goto Label11
Label10:
// line 250: return FALSE
πF.SetLineno(250)
// line 251: return FALSE
πF.SetLineno(251)
if πTemp001, πE = πg.ResolveGlobal(πF, ßFALSE); πE != nil {
continue
}
......@@ -2751,8 +2764,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßFunc2.ToObject(), πTemp017); πE != nil {
continue
}
// line 252: def Func3(EnumParIn):
πF.SetLineno(252)
// line 253: def Func3(EnumParIn):
πF.SetLineno(253)
πTemp009 = make([]πg.Param, 1)
πTemp009[0] = πg.Param{Name: "EnumParIn", Def: nil}
πTemp018 = πg.NewFunction(πg.NewCode("Func3", "pystone.py", πTemp009, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
......@@ -2770,8 +2783,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 253: EnumLoc = EnumParIn
πF.SetLineno(253)
// line 254: EnumLoc = EnumParIn
πF.SetLineno(254)
if πE = πg.CheckLocal(πF, µEnumParIn, "EnumParIn"); πE != nil {
continue
}
......@@ -2792,19 +2805,19 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label1
}
goto Label2
// line 254: if EnumLoc == Ident3: return TRUE
πF.SetLineno(254)
// line 255: if EnumLoc == Ident3: return TRUE
πF.SetLineno(255)
Label1:
// line 254: if EnumLoc == Ident3: return TRUE
πF.SetLineno(254)
// line 255: if EnumLoc == Ident3: return TRUE
πF.SetLineno(255)
if πTemp001, πE = πg.ResolveGlobal(πF, ßTRUE); πE != nil {
continue
}
return πTemp001, nil
goto Label2
Label2:
// line 255: return FALSE
πF.SetLineno(255)
// line 256: return FALSE
πF.SetLineno(256)
if πTemp001, πE = πg.ResolveGlobal(πF, ßFALSE); πE != nil {
continue
}
......@@ -2829,11 +2842,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label1
}
goto Label2
// line 257: if __name__ == '__main__':
πF.SetLineno(257)
Label1:
// line 258: import sys
// line 258: if __name__ == '__main__':
πF.SetLineno(258)
Label1:
// line 259: import sys
πF.SetLineno(259)
if πTemp002, πE = πg.ImportModule(πF, "sys", []*πg.Code{π___python__Γsys.Code}); πE != nil {
continue
}
......@@ -2841,8 +2854,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßsys.ToObject(), πTemp019); πE != nil {
continue
}
// line 259: def error(msg):
πF.SetLineno(259)
// line 260: def error(msg):
πF.SetLineno(260)
πTemp009 = make([]πg.Param, 1)
πTemp009[0] = πg.Param{Name: "msg", Def: nil}
πTemp019 = πg.NewFunction(πg.NewCode("error", "pystone.py", πTemp009, 0, func(πF *πg.Frame, πArgs []*πg.Object) (*πg.Object, *πg.BaseException) {
......@@ -2865,8 +2878,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
case 0:
default: panic("unexpected function state")
}
// line 260: print >>sys.stderr, msg,
πF.SetLineno(260)
// line 261: print >>sys.stderr, msg,
πF.SetLineno(261)
πTemp001 = make([]*πg.Object, 1)
if πE = πg.CheckLocal(πF, µmsg, "msg"); πE != nil {
continue
......@@ -2875,8 +2888,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.Print(πF, πTemp001, false); πE != nil {
continue
}
// line 261: print >>sys.stderr, "usage: %s [number_of_loops]" % sys.argv[0]
πF.SetLineno(261)
// line 262: print >>sys.stderr, "usage: %s [number_of_loops]" % sys.argv[0]
πF.SetLineno(262)
πTemp001 = make([]*πg.Object, 1)
πTemp003 = πg.NewInt(0).ToObject()
if πTemp005, πE = πg.ResolveGlobal(πF, ßsys); πE != nil {
......@@ -2895,8 +2908,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πg.Print(πF, πTemp001, true); πE != nil {
continue
}
// line 262: sys.exit(100)
πF.SetLineno(262)
// line 263: sys.exit(100)
πF.SetLineno(263)
πTemp001 = πF.MakeArgs(1)
πTemp001[0] = πg.NewInt(100).ToObject()
if πTemp002, πE = πg.ResolveGlobal(πF, ßsys); πE != nil {
......@@ -2916,8 +2929,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
if πE = πF.Globals().SetItem(πF, ßerror.ToObject(), πTemp019); πE != nil {
continue
}
// line 263: nargs = len(sys.argv) - 1
πF.SetLineno(263)
// line 264: nargs = len(sys.argv) - 1
πF.SetLineno(264)
πTemp002 = πF.MakeArgs(1)
if πTemp022, πE = πg.ResolveGlobal(πF, ßsys); πE != nil {
continue
......@@ -2964,11 +2977,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
goto Label4
}
goto Label5
// line 264: if nargs > 1:
πF.SetLineno(264)
Label3:
// line 265: error("%d arguments are too many;" % nargs)
// line 265: if nargs > 1:
πF.SetLineno(265)
Label3:
// line 266: error("%d arguments are too many;" % nargs)
πF.SetLineno(266)
πTemp002 = πF.MakeArgs(1)
if πTemp022, πE = πg.ResolveGlobal(πF, ßnargs); πE != nil {
continue
......@@ -2985,14 +2998,14 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
}
πF.FreeArgs(πTemp002)
goto Label6
// line 266: elif nargs == 1:
πF.SetLineno(266)
Label4:
// line 267: try: loops = int(sys.argv[1])
// line 267: elif nargs == 1:
πF.SetLineno(267)
Label4:
// line 268: try: loops = int(sys.argv[1])
πF.SetLineno(268)
πF.PushCheckpoint(8)
// line 267: try: loops = int(sys.argv[1])
πF.SetLineno(267)
// line 268: try: loops = int(sys.argv[1])
πF.SetLineno(268)
πTemp002 = πF.MakeArgs(1)
πTemp020 = πg.NewInt(1).ToObject()
if πTemp023, πE = πg.ResolveGlobal(πF, ßsys); πE != nil {
......@@ -3030,11 +3043,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
}
πE = πF.Raise(πTemp025.ToObject(), nil, πTemp026.ToObject())
continue
// line 268: except ValueError:
πF.SetLineno(268)
Label9:
// line 269: error("Invalid argument %r;" % sys.argv[1])
// line 269: except ValueError:
πF.SetLineno(269)
Label9:
// line 270: error("Invalid argument %r;" % sys.argv[1])
πF.SetLineno(270)
πTemp002 = πF.MakeArgs(1)
πTemp022 = πg.NewInt(1).ToObject()
if πTemp024, πE = πg.ResolveGlobal(πF, ßsys); πE != nil {
......@@ -3063,8 +3076,8 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
Label7:
goto Label6
Label5:
// line 271: loops = LOOPS
πF.SetLineno(271)
// line 272: loops = LOOPS
πF.SetLineno(272)
if πTemp020, πE = πg.ResolveGlobal(πF, ßLOOPS); πE != nil {
continue
}
......@@ -3073,8 +3086,11 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
}
goto Label6
Label6:
// line 272: main(loops)
πF.SetLineno(272)
// line 273: try:
πF.SetLineno(273)
πF.PushCheckpoint(11)
// line 274: main(loops)
πF.SetLineno(274)
πTemp002 = πF.MakeArgs(1)
if πTemp020, πE = πg.ResolveGlobal(πF, ßloops); πE != nil {
continue
......@@ -3087,6 +3103,26 @@ func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseExceptio
continue
}
πF.FreeArgs(πTemp002)
πF.PopCheckpoint()
goto Label10
// line 275: except:
πF.SetLineno(275)
Label11:
// line 276: traceback.print_exc()
πF.SetLineno(276)
if πTemp020, πE = πg.ResolveGlobal(πF, ßtraceback); πE != nil {
continue
}
if πTemp022, πE = πg.GetAttr(πF, πTemp020, ßprint_exc, nil); πE != nil {
continue
}
if πTemp020, πE = πTemp022.Call(πF, nil, nil); πE != nil {
continue
}
πE = nil
πF.RestoreExc(nil, nil)
goto Label10
Label10:
goto Label2
Label2:
return nil, nil
......
......@@ -37,6 +37,7 @@ LOOPS = 50000
#from time import clock
import time
clock = time.clock
import traceback
__version__ = "1.1"
......@@ -269,4 +270,7 @@ if __name__ == '__main__':
error("Invalid argument %r;" % sys.argv[1])
else:
loops = LOOPS
main(loops)
try:
main(loops)
except:
traceback.print_exc()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment