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> | 5 #include <u.h> |
6 #include <libc.h> | 6 #include <libc.h> |
7 #include "go.h" | 7 #include "go.h" |
8 #include "md5.h" | 8 #include "md5.h" |
9 #include "y.tab.h" | 9 #include "y.tab.h" |
10 #include "yerr.h" | 10 #include "yerr.h" |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 freenodelist(n->nelse); | 513 freenodelist(n->nelse); |
514 | 514 |
515 freelist = list(freelist, n); | 515 freelist = list(freelist, n); |
516 } | 516 } |
517 | 517 |
518 Node* | 518 Node* |
519 nod(int op, Node *nleft, Node *nright) | 519 nod(int op, Node *nleft, Node *nright) |
520 { | 520 { |
521 Node *n; | 521 Node *n; |
522 | 522 |
523 » nodused++; | 523 //» thingsused++; |
524 if (freelist != nil) { | 524 if (freelist != nil) { |
525 n = freelist->n; | 525 n = freelist->n; |
526 freelist = freelist->next; | 526 freelist = freelist->next; |
527 memset(n, 0, sizeof(*n)); | 527 memset(n, 0, sizeof(*n)); |
528 } else {········ | 528 } else {········ |
529 n = mal(sizeof(*n)); | 529 n = mal(sizeof(*n)); |
530 » » nodallocs++; | 530 //» » thingsallocs++; |
531 } | 531 } |
532 n->op = op; | 532 n->op = op; |
533 n->left = nleft; | 533 n->left = nleft; |
534 n->right = nright; | 534 n->right = nright; |
535 n->lineno = parserline(); | 535 n->lineno = parserline(); |
536 n->xoffset = BADWIDTH; | 536 n->xoffset = BADWIDTH; |
537 n->orig = n; | 537 n->orig = n; |
538 n->curfn = curfn; | 538 n->curfn = curfn; |
539 return n; | 539 return n; |
540 } | 540 } |
(...skipping 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3700 yyerror("import path contains space character: \"%Z\"",
path); | 3700 yyerror("import path contains space character: \"%Z\"",
path); |
3701 return 1; | 3701 return 1; |
3702 } | 3702 } |
3703 if(utfrune("!\"#$%&'()*,:;<=>?[]^`{|}", r)) { | 3703 if(utfrune("!\"#$%&'()*,:;<=>?[]^`{|}", r)) { |
3704 yyerror("import path contains invalid character '%C': \"
%Z\"", r, path); | 3704 yyerror("import path contains invalid character '%C': \"
%Z\"", r, path); |
3705 return 1; | 3705 return 1; |
3706 } | 3706 } |
3707 } | 3707 } |
3708 return 0; | 3708 return 0; |
3709 } | 3709 } |
LEFT | RIGHT |