Skip to content

Commit

Permalink
Implement cap, len, and make, as well as the general framework
Browse files Browse the repository at this point in the history
for built-in functions and type conversions.  Extract out
common operations on expression nodes for converting them to
ints and implicitly dereferencing arrays.

R=rsc
APPROVED=rsc
DELTA=442  (365 added, 50 deleted, 27 changed)
OCL=34064
CL=34064
  • Loading branch information
aclements committed Aug 29, 2009
1 parent e667e8a commit c90bc34
Show file tree
Hide file tree
Showing 4 changed files with 392 additions and 77 deletions.
18 changes: 17 additions & 1 deletion usr/austin/eval/abort.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,21 @@ type KeyNotFound struct {
}

func (e KeyNotFound) String() string {
return fmt.Sprintf("key %s not found in map", e.Key);
return fmt.Sprintf("key '%v' not found in map", e.Key);
}

type NegativeLength struct {
Len int64;
}

func (e NegativeLength) String() string {
return fmt.Sprintf("negative length: %d", e.Len);
}

type NegativeCapacity struct {
Len int64;
}

func (e NegativeCapacity) String() string {
return fmt.Sprintf("negative capacity: %d", e.Len);
}
Loading

0 comments on commit c90bc34

Please sign in to comment.