LEFT | RIGHT |
(no file at all) | |
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 #include "go.h" | 5 #include "go.h" |
6 | 6 |
7 static Node* walkprint(Node*, NodeList**, int); | 7 static Node* walkprint(Node*, NodeList**, int); |
8 static Node* conv(Node*, Type*); | 8 static Node* conv(Node*, Type*); |
9 static Node* mapfn(char*, Type*); | 9 static Node* mapfn(char*, Type*); |
10 static Node* makenewvar(Type*, NodeList**, Node**); | 10 static Node* makenewvar(Type*, NodeList**, Node**); |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 walkexpr(&n->left, init); | 763 walkexpr(&n->left, init); |
764 walkexprlist(n->list, init); | 764 walkexprlist(n->list, init); |
765 ll = ascompatte(n->op, n->isddd, getinarg(t), n->list, 0, init); | 765 ll = ascompatte(n->op, n->isddd, getinarg(t), n->list, 0, init); |
766 n->list = reorder1(ll); | 766 n->list = reorder1(ll); |
767 goto ret; | 767 goto ret; |
768 | 768 |
769 case OCALLFUNC: | 769 case OCALLFUNC: |
770 t = n->left->type; | 770 t = n->left->type; |
771 if(n->list && n->list->n->op == OAS) | 771 if(n->list && n->list->n->op == OAS) |
772 goto ret; | 772 goto ret; |
773 » » walkexpr(&n->left, init); | 773 |
| 774 » » if(n->left->op == OCLOSURE) { |
| 775 » » » walkcallclosure(n, init); |
| 776 » » » t = n->left->type; |
| 777 » » } else |
| 778 » » » walkexpr(&n->left, init); |
| 779 |
774 walkexprlist(n->list, init); | 780 walkexprlist(n->list, init); |
| 781 |
775 ll = ascompatte(n->op, n->isddd, getinarg(t), n->list, 0, init); | 782 ll = ascompatte(n->op, n->isddd, getinarg(t), n->list, 0, init); |
776 n->list = reorder1(ll); | 783 n->list = reorder1(ll); |
777 if(isselect(n)) { | 784 if(isselect(n)) { |
778 // special prob with selectsend and selectrecv: | 785 // special prob with selectsend and selectrecv: |
779 // if chan is nil, they don't know big the channel | 786 // if chan is nil, they don't know big the channel |
780 // element is and therefore don't know how to find | 787 // element is and therefore don't know how to find |
781 // the output bool, so we clear it before the call. | 788 // the output bool, so we clear it before the call. |
782 Node *b; | 789 Node *b; |
783 b = nodbool(0); | 790 b = nodbool(0); |
784 typecheck(&b, Erv); | 791 typecheck(&b, Erv); |
(...skipping 1656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 l = list(l, nod(OAS, nx, a->n)); // s[n] = arg | 2448 l = list(l, nod(OAS, nx, a->n)); // s[n] = arg |
2442 if (a->next != nil) | 2449 if (a->next != nil) |
2443 l = list(l, nod(OAS, nn, nod(OADD, nn, nodintconst(1))))
; // n = n + 1 | 2450 l = list(l, nod(OAS, nn, nod(OADD, nn, nodintconst(1))))
; // n = n + 1 |
2444 } | 2451 } |
2445 | 2452 |
2446 typechecklist(l, Etop); | 2453 typechecklist(l, Etop); |
2447 walkstmtlist(l); | 2454 walkstmtlist(l); |
2448 *init = concat(*init, l); | 2455 *init = concat(*init, l); |
2449 return ns; | 2456 return ns; |
2450 } | 2457 } |
LEFT | RIGHT |