LEFT | RIGHT |
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 Loading... |
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 Loading... |
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 } |
LEFT | RIGHT |