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 #include <u.h> |
| 6 #include <libc.h> |
5 #include "go.h" | 7 #include "go.h" |
6 | 8 |
7 static Node* walkprint(Node*, NodeList**, int); | 9 static Node* walkprint(Node*, NodeList**, int); |
8 static Node* conv(Node*, Type*); | 10 static Node* conv(Node*, Type*); |
9 static Node* mapfn(char*, Type*); | 11 static Node* mapfn(char*, Type*); |
10 static Node* makenewvar(Type*, NodeList**, Node**); | 12 static Node* makenewvar(Type*, NodeList**, Node**); |
11 static Node* ascompatee1(int, Node*, Node*, NodeList**); | 13 static Node* ascompatee1(int, Node*, Node*, NodeList**); |
12 static NodeList* ascompatee(int, NodeList*, NodeList*, NodeList**); | 14 static NodeList* ascompatee(int, NodeList*, NodeList*, NodeList**); |
13 static NodeList* ascompatet(int, NodeList*, Type**, int, NodeList**); | 15 static NodeList* ascompatet(int, NodeList*, Type**, int, NodeList**); |
14 static NodeList* ascompatte(int, Node*, int, Type**, NodeList*, int, Node
List**); | 16 static NodeList* ascompatte(int, Node*, int, Type**, NodeList*, int, Node
List**); |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 *init = list(*init, nas); | 1205 *init = list(*init, nas); |
1204 | 1206 |
1205 *nstar = nod(OIND, nvar, N); | 1207 *nstar = nod(OIND, nvar, N); |
1206 typecheck(nstar, Erv); | 1208 typecheck(nstar, Erv); |
1207 return nvar; | 1209 return nvar; |
1208 } | 1210 } |
1209 | 1211 |
1210 static Node* | 1212 static Node* |
1211 ascompatee1(int op, Node *l, Node *r, NodeList **init) | 1213 ascompatee1(int op, Node *l, Node *r, NodeList **init) |
1212 { | 1214 { |
| 1215 USED(op); |
| 1216 |
1213 return convas(nod(OAS, l, r), init); | 1217 return convas(nod(OAS, l, r), init); |
1214 } | 1218 } |
1215 | 1219 |
1216 static NodeList* | 1220 static NodeList* |
1217 ascompatee(int op, NodeList *nl, NodeList *nr, NodeList **init) | 1221 ascompatee(int op, NodeList *nl, NodeList *nr, NodeList **init) |
1218 { | 1222 { |
1219 NodeList *ll, *lr, *nn; | 1223 NodeList *ll, *lr, *nn; |
1220 | 1224 |
1221 /* | 1225 /* |
1222 * check assign expression list to | 1226 * check assign expression list to |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 | 1262 |
1259 static NodeList* | 1263 static NodeList* |
1260 ascompatet(int op, NodeList *nl, Type **nr, int fp, NodeList **init) | 1264 ascompatet(int op, NodeList *nl, Type **nr, int fp, NodeList **init) |
1261 { | 1265 { |
1262 Node *l, *tmp, *a; | 1266 Node *l, *tmp, *a; |
1263 NodeList *ll; | 1267 NodeList *ll; |
1264 Type *r; | 1268 Type *r; |
1265 Iter saver; | 1269 Iter saver; |
1266 int ucount; | 1270 int ucount; |
1267 NodeList *nn, *mm; | 1271 NodeList *nn, *mm; |
| 1272 |
| 1273 USED(op); |
1268 | 1274 |
1269 /* | 1275 /* |
1270 * check assign type list to | 1276 * check assign type list to |
1271 * a expression list. called in | 1277 * a expression list. called in |
1272 * expr-list = func() | 1278 * expr-list = func() |
1273 */ | 1279 */ |
1274 r = structfirst(&saver, nr); | 1280 r = structfirst(&saver, nr); |
1275 nn = nil; | 1281 nn = nil; |
1276 mm = nil; | 1282 mm = nil; |
1277 ucount = 0; | 1283 ucount = 0; |
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2176 l = list(l, nod(OAS, nx, a->n)); // s[n] = arg | 2182 l = list(l, nod(OAS, nx, a->n)); // s[n] = arg |
2177 if (a->next != nil) | 2183 if (a->next != nil) |
2178 l = list(l, nod(OAS, nn, nod(OADD, nn, nodintconst(1))))
; // n = n + 1 | 2184 l = list(l, nod(OAS, nn, nod(OADD, nn, nodintconst(1))))
; // n = n + 1 |
2179 } | 2185 } |
2180 | 2186 |
2181 typechecklist(l, Etop); | 2187 typechecklist(l, Etop); |
2182 walkstmtlist(l); | 2188 walkstmtlist(l); |
2183 *init = concat(*init, l); | 2189 *init = concat(*init, l); |
2184 return ns; | 2190 return ns; |
2185 } | 2191 } |
LEFT | RIGHT |