Skip to content

Commit 4b9bdd5

Browse files
committed
Change from panic/recover error handling to go style error values
* Speeds up interpreter by 35% * errchk is clean * symtable module still has panics which can escape
1 parent 9d45873 commit 4b9bdd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2752
-2071
lines changed

ast/dump.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,11 @@ func dumpItem(v interface{}) string {
4646
case Ast:
4747
return Dump(x)
4848
case py.I__str__:
49-
return string(x.M__str__().(py.String))
49+
str, err := x.M__str__()
50+
if err != nil {
51+
panic(err)
52+
}
53+
return string(str.(py.String))
5054
case Comprehension:
5155
return dump(v, "comprehension")
5256
}

0 commit comments

Comments
 (0)