Skip to content

Commit

Permalink
Change from panic/recover error handling to go style error values
Browse files Browse the repository at this point in the history
  * Speeds up interpreter by 35%
  * errchk is clean
  * symtable module still has panics which can escape
  • Loading branch information
ncw committed May 30, 2015
1 parent 9d45873 commit 4b9bdd5
Show file tree
Hide file tree
Showing 51 changed files with 2,752 additions and 2,071 deletions.
6 changes: 5 additions & 1 deletion ast/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ func dumpItem(v interface{}) string {
case Ast:
return Dump(x)
case py.I__str__:
return string(x.M__str__().(py.String))
str, err := x.M__str__()
if err != nil {
panic(err)
}
return string(str.(py.String))
case Comprehension:
return dump(v, "comprehension")
}
Expand Down
Loading

0 comments on commit 4b9bdd5

Please sign in to comment.