Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(331)

Delta Between Two Patch Sets: src/pkg/exp/eval/expr.go

Issue 157082: code review 157082: Permit omission of hi bound in slices. (Closed)
Left Patch Set: code review 157082: Permit omission of hi bound in slices. Created 15 years, 4 months ago
Right Patch Set: code review 157082: Permit omission of hi bound in slices. Created 15 years, 4 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/cgo/ast.go ('k') | src/pkg/go/ast/ast.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package eval 5 package eval
6 6
7 import ( 7 import (
8 "bignum"; 8 "bignum";
9 "go/ast"; 9 "go/ast";
10 "go/token"; 10 "go/token";
(...skipping 573 matching lines...) Expand 10 before | Expand all | Expand 10 after
584 l, r := a.compile(x.X, false), a.compile(x.Index, false); 584 l, r := a.compile(x.X, false), a.compile(x.Index, false);
585 if l == nil || r == nil { 585 if l == nil || r == nil {
586 return nil 586 return nil
587 } 587 }
588 return ei.compileIndexExpr(l, r); 588 return ei.compileIndexExpr(l, r);
589 589
590 case *ast.SliceExpr: 590 case *ast.SliceExpr:
591 end := x.End; 591 end := x.End;
592 if end == nil { 592 if end == nil {
593 // TODO: set end to len(x.X) 593 // TODO: set end to len(x.X)
594 » » » panic("unimplemented"); 594 » » » panic("unimplemented")
595 } 595 }
596 arr := a.compile(x.X, false); 596 arr := a.compile(x.X, false);
597 lo := a.compile(x.Index, false); 597 lo := a.compile(x.Index, false);
598 hi := a.compile(end, false); 598 hi := a.compile(end, false);
599 if arr == nil || lo == nil || hi == nil { 599 if arr == nil || lo == nil || hi == nil {
600 return nil 600 return nil
601 } 601 }
602 return ei.compileSliceExpr(arr, lo, hi); 602 return ei.compileSliceExpr(arr, lo, hi);
603 603
604 case *ast.KeyValueExpr: 604 case *ast.KeyValueExpr:
(...skipping 1372 matching lines...) Expand 10 before | Expand all | Expand 10 after
1977 if a.evalAddr == nil { 1977 if a.evalAddr == nil {
1978 return effect, getTemp 1978 return effect, getTemp
1979 } 1979 }
1980 1980
1981 deref := a.compileStarExpr(getTemp); 1981 deref := a.compileStarExpr(getTemp);
1982 if deref == nil { 1982 if deref == nil {
1983 return nil, nil 1983 return nil, nil
1984 } 1984 }
1985 return effect, deref; 1985 return effect, deref;
1986 } 1986 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b