Changeset 931 for trunk/rebuild
- Timestamp:
- 09/13/08 11:19:13 (4 months ago)
- Files:
-
- trunk/rebuild/link.c (modified) (1 diff)
- trunk/rebuild/mars.c (modified) (2 diffs)
- trunk/rebuild/parse.c (modified) (63 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/rebuild/link.c
r922 r931 227 227 global.params.exefile = strdup(out.c_str()); 228 228 } 229 229 230 230 // do we even need to do the build? 231 231 if (global.params.fullbuild || trunk/rebuild/mars.c
r928 r931 1007 1007 global.params.useAssert = 1; 1008 1008 1009 if (!global.params.obj || global.params.lib)1009 if (!global.params.obj) 1010 1010 global.params.link = 0; 1011 1011 … … 1723 1723 1724 1724 mem.fullcollect(); 1725 1725 1726 1726 // Now do the actual compilation, across any number of processors 1727 1727 #ifndef _WIN32 trunk/rebuild/parse.c
r921 r931 74 74 nextToken(); 75 75 if (token.value != TOKidentifier) 76 { error("Identifier expected following module");76 { /* error("Identifier expected following module"); */ 77 77 goto Lerr; 78 78 } … … 90 90 nextToken(); 91 91 if (token.value != TOKidentifier) 92 { error("Identifier expected following package");92 { /* error("Identifier expected following package"); */ 93 93 goto Lerr; 94 94 } … … 98 98 md = new ModuleDeclaration(a, id); 99 99 100 if (token.value != TOKsemicolon)101 error("';' expected following module declaration instead of %s", token.toChars()); 100 /* if (token.value != TOKsemicolon) 101 error("';' expected following module declaration instead of %s", token.toChars()); */ 102 102 nextToken(); 103 103 addComment(mod, comment); … … 107 107 decldefs = parseDeclDefs(0); 108 108 if (token.value != TOKeof) 109 { error("unrecognized declaration");109 { /* error("unrecognized declaration"); */ 110 110 goto Lerr; 111 111 } … … 390 390 case TOKpublic: 391 391 case TOKexport: 392 error("redundant protection attribute");392 /* error("redundant protection attribute"); */ 393 393 break; 394 394 } … … 408 408 n = (unsigned)token.uns64value; 409 409 else 410 { error("integer expected, not %s", token.toChars());410 { /* error("integer expected, not %s", token.toChars()); */ 411 411 n = 1; 412 412 } … … 429 429 check(TOKlparen); 430 430 if (token.value != TOKidentifier) 431 { error("pragma(identifier expected");431 { /* error("pragma(identifier expected"); */ 432 432 goto Lerror; 433 433 } … … 457 457 s = new DebugSymbol(loc, (unsigned)token.uns64value); 458 458 else 459 { error("identifier or integer expected, not %s", token.toChars());459 { /* error("identifier or integer expected, not %s", token.toChars()); */ 460 460 s = NULL; 461 461 } 462 462 nextToken(); 463 if (token.value != TOKsemicolon)464 error("semicolon expected"); 463 /* if (token.value != TOKsemicolon) 464 error("semicolon expected"); */ 465 465 nextToken(); 466 466 break; … … 480 480 s = new VersionSymbol(loc, (unsigned)token.uns64value); 481 481 else 482 { error("identifier or integer expected, not %s", token.toChars());482 { /* error("identifier or integer expected, not %s", token.toChars()); */ 483 483 s = NULL; 484 484 } 485 485 nextToken(); 486 if (token.value != TOKsemicolon)487 error("semicolon expected"); 486 /* if (token.value != TOKsemicolon) 487 error("semicolon expected"); */ 488 488 nextToken(); 489 489 break; … … 537 537 { 538 538 case TOKsemicolon: 539 error("declaration expected following attribute, not ';'");539 /* error("declaration expected following attribute, not ';'"); */ 540 540 nextToken(); 541 541 break; … … 546 546 if (token.value != TOKrcurly) 547 547 { /* { */ 548 error("matching '}' expected, not %s", token.toChars());548 /* error("matching '}' expected, not %s", token.toChars()); */ 549 549 } 550 550 else … … 656 656 else 657 657 { 658 error("valid linkage identifiers are D, C, C++, Pascal, Windows, System");658 /* error("valid linkage identifiers are D, C, C++, Pascal, Windows, System"); */ 659 659 link = LINKd; 660 660 } … … 686 686 else if (token.value == TOKint32v) 687 687 level = (unsigned)token.uns64value; 688 else689 error("identifier or integer expected, not %s", token.toChars()); 688 /* else 689 error("identifier or integer expected, not %s", token.toChars()); */ 690 690 nextToken(); 691 691 check(TOKrparen); … … 723 723 id = Lexer::idPool(Token::toChars(TOKunittest)); 724 724 #endif 725 else726 error("identifier or integer expected, not %s", token.toChars()); 725 /* else 726 error("identifier or integer expected, not %s", token.toChars()); */ 727 727 nextToken(); 728 728 check(TOKrparen); 729 729 730 730 } 731 else732 error("(condition) expected following version"); 731 /* else 732 error("(condition) expected following version"); */ 733 733 c = new VersionCondition(mod, level, id); 734 734 return c; … … 758 758 } 759 759 else 760 { error("(expression) expected following static if");760 { /* error("(expression) expected following static if"); */ 761 761 exp = NULL; 762 762 } … … 956 956 nextToken(); 957 957 arguments = parseParameters(&varargs); 958 if (varargs)959 error("... not allowed in delete function parameter list"); 958 /* if (varargs) 959 error("... not allowed in delete function parameter list"); */ 960 960 f = new DeleteDeclaration(loc, 0, arguments); 961 961 parseContracts(f); … … 1172 1172 { 1173 1173 type = parseType(&ident, NULL); 1174 if (id || memtype)1175 error("type only allowed if anonymous enum and no enum type"); 1174 /* if (id || memtype) 1175 error("type only allowed if anonymous enum and no enum type"); */ 1176 1176 } 1177 1177 … … 1184 1184 else 1185 1185 { value = NULL; 1186 if (type)1187 error("if type, there must be an initializer"); 1186 /* if (type) 1187 error("if type, there must be an initializer"); */ 1188 1188 } 1189 1189 … … 1203 1203 nextToken(); 1204 1204 } 1205 else1206 error("enum declaration is invalid"); 1205 /* else 1206 error("enum declaration is invalid"); */ 1207 1207 1208 1208 //printf("-parseEnum() %s\n", e->toChars()); … … 1252 1252 baseclasses = parseBaseClasses(); 1253 1253 1254 if (token.value != TOKlcurly)1255 error("members expected"); 1254 /* if (token.value != TOKlcurly) 1255 error("members expected"); */ 1256 1256 } 1257 1257 … … 1289 1289 nextToken(); 1290 1290 Array *decl = parseDeclDefs(0); 1291 if (token.value != TOKrcurly)1292 error("} expected following member declarations in aggregate"); 1291 /* if (token.value != TOKrcurly) 1292 error("} expected following member declarations in aggregate"); */ 1293 1293 nextToken(); 1294 1294 if (anon) … … 1303 1303 else 1304 1304 { 1305 error("{ } expected following aggregate declaration");1305 /* error("{ } expected following aggregate declaration"); */ 1306 1306 a = new StructDeclaration(loc, NULL); 1307 1307 } … … 1358 1358 else 1359 1359 { 1360 error("base classes expected instead of %s", token.toChars());1360 /* error("base classes expected instead of %s", token.toChars()); */ 1361 1361 return NULL; 1362 1362 } … … 1401 1401 nextToken(); 1402 1402 if (token.value != TOKidentifier) 1403 { error("TemplateIdentifier expected following template");1403 { /* error("TemplateIdentifier expected following template"); */ 1404 1404 goto Lerr; 1405 1405 } … … 1413 1413 1414 1414 if (token.value != TOKlcurly) 1415 { error("members of template declaration expected");1415 { /* error("members of template declaration expected"); */ 1416 1416 goto Lerr; 1417 1417 } … … 1421 1421 decldefs = parseDeclDefs(0); 1422 1422 if (token.value != TOKrcurly) 1423 { error("template member expected");1423 { /* error("template member expected"); */ 1424 1424 goto Lerr; 1425 1425 } … … 1446 1446 1447 1447 if (!flag && token.value != TOKlparen) 1448 { error("parenthesized TemplateParameterList expected following TemplateIdentifier");1448 { /* error("parenthesized TemplateParameterList expected following TemplateIdentifier"); */ 1449 1449 goto Lerr; 1450 1450 } … … 1480 1480 { 1481 1481 if (token.value != TOKidentifier) 1482 { error("identifier expected for template alias parameter");1482 { /* error("identifier expected for template alias parameter"); */ 1483 1483 goto Lerr; 1484 1484 } … … 1510 1510 { // TypeParameter 1511 1511 if (token.value != TOKidentifier) 1512 { error("identifier expected for template type parameter");1512 { /* error("identifier expected for template type parameter"); */ 1513 1513 goto Lerr; 1514 1514 } … … 1529 1529 else if (token.value == TOKidentifier && t->value == TOKdotdotdot) 1530 1530 { // ident... 1531 if (isvariadic)1532 error("variadic template parameter must be last"); 1531 /* if (isvariadic) 1532 error("variadic template parameter must be last"); */ 1533 1533 isvariadic = 1; 1534 1534 tp_ident = token.ident; … … 1565 1565 if (!tp_ident) 1566 1566 { 1567 error("identifier expected for template value parameter");1567 /* error("identifier expected for template value parameter"); */ 1568 1568 tp_ident = new Identifier("error", TOKidentifier); 1569 1569 } … … 1624 1624 if (token.value != TOKidentifier) 1625 1625 { 1626 error("identifier expected, not %s", token.toChars());1626 /* error("identifier expected, not %s", token.toChars()); */ 1627 1627 id = Id::empty; 1628 1628 } … … 1655 1655 nextToken(); 1656 1656 if (token.value != TOKidentifier) 1657 { error("identifier expected following '.' instead of '%s'", token.toChars());1657 { /* error("identifier expected following '.' instead of '%s'", token.toChars()); */ 1658 1658 break; 1659 1659 } … … 1672 1672 1673 1673 tm = new TemplateMixin(loc, id, tqual, idents, tiargs); 1674 if (token.value != TOKsemicolon)1675 error("';' expected after mixin"); 1674 /* if (token.value != TOKsemicolon) 1675 error("';' expected after mixin"); */ 1676 1676 nextToken(); 1677 1677 … … 1691 1691 //printf("Parser::parseTemplateArgumentList()\n"); 1692 1692 if (token.value != TOKlparen) 1693 { error("!(TemplateArgumentList) expected following TemplateIdentifier");1693 { /* error("!(TemplateArgumentList) expected following TemplateIdentifier"); */ 1694 1694 return new Objects(); 1695 1695 } … … 1740 1740 nextToken(); 1741 1741 if (token.value != TOKidentifier) 1742 { error("Identifier expected following import");1742 { /* error("Identifier expected following import"); */ 1743 1743 break; 1744 1744 } … … 1760 1760 nextToken(); 1761 1761 if (token.value != TOKidentifier) 1762 { error("Identifier expected following package");1762 { /* error("Identifier expected following package"); */ 1763 1763 break; 1764 1764 } … … 1782 1782 nextToken(); 1783 1783 if (token.value != TOKidentifier) 1784 { error("Identifier expected following :");1784 { /* error("Identifier expected following :"); */ 1785 1785 break; 1786 1786 } … … 1791 1791 nextToken(); 1792 1792 if (token.value != TOKidentifier) 1793 { error("Identifier expected following %s=", alias->toChars());1793 { /* error("Identifier expected following %s=", alias->toChars()); */ 1794 1794 break; 1795 1795 } … … 1813 1813 else 1814 1814 { 1815 error("';' expected");1815 /* error("';' expected"); */ 1816 1816 nextToken(); 1817 1817 } … … 1876 1876 { nextToken(); 1877 1877 if (token.value != TOKidentifier) 1878 { error("identifier expected following '.' instead of '%s'", token.toChars());1878 { /* error("identifier expected following '.' instead of '%s'", token.toChars()); */ 1879 1879 break; 1880 1880 } … … 1923 1923 1924 1924 default: 1925 error("basic type expected, not %s", token.toChars());1925 /* error("basic type expected, not %s", token.toChars()); */ 1926 1926 t = Type::tint32; 1927 1927 break; … … 2250 2250 unsigned u = storage_class; 2251 2251 u &= STCconst | STCinvariant | STCmanifest; 2252 if (u & (u - 1))2253 error("conflicting storage class %s", Token::toChars(token.value)); 2252 /* if (u & (u - 1)) 2253 error("conflicting storage class %s", Token::toChars(token.value)); */ 2254 2254 } 2255 2255 nextToken(); … … 2327 2327 error("multiple declarations must have the same type, not %s and %s", 2328 2328 tfirst->toChars(), t->toChars()); */ 2329 if (!ident)2330 error("no identifier for declarator %s", t->toChars()); 2329 /* if (!ident) 2330 error("no identifier for declarator %s", t->toChars()); */ 2331 2331 2332 2332 if (tok == TOKtypedef || tok == TOKalias) … … 2368 2368 2369 2369 default: 2370 error("semicolon expected to close %s declaration", Token::toChars(tok));2370 /* error("semicolon expected to close %s declaration", Token::toChars(tok)); */ 2371 2371 break; 2372 2372 } … … 2447 2447 2448 2448 default: 2449 error("semicolon expected, not '%s'", token.toChars());2449 /* error("semicolon expected, not '%s'", token.toChars()); */ 2450 2450 break; 2451 2451 } … … 2493 2493 continue; 2494 2494 } 2495 else2496 error("Identifier expected following comma"); 2497 } 2498 else2499 error("semicolon expected following auto declaration, not '%s'", token.toChars()); 2495 /* else 2496 error("Identifier expected following comma"); */ 2497 } 2498 /* else 2499 error("semicolon expected following auto declaration, not '%s'", token.toChars()); */ 2500 2500 break; 2501 2501 } … … 2520 2520 { 2521 2521 case TOKlcurly: 2522 if (f->frequire || f->fensure)2523 error("missing body { ... } after in or out"); 2522 /* if (f->frequire || f->fensure) 2523 error("missing body { ... } after in or out"); */ 2524 2524 f->fbody = parseStatement(PSsemi); 2525 2525 f->endloc = endloc; … … 2533 2533 2534 2534 case TOKsemicolon: 2535 if (f->frequire || f->fensure)2536 error("missing body { ... } after in or out"); 2535 /* if (f->frequire || f->fensure) 2536 error("missing body { ... } after in or out"); */ 2537 2537 nextToken(); 2538 2538 break; … … 2578 2578 { 2579 2579 check(TOKlparen); 2580 if (token.value != TOKidentifier)2581 error("(identifier) following 'out' expected, not %s", token.toChars()); 2580 /* if (token.value != TOKidentifier) 2581 error("(identifier) following 'out' expected, not %s", token.toChars()); */ 2582 2582 f->outId = token.ident; 2583 2583 nextToken(); … … 2590 2590 2591 2591 default: 2592 error("semicolon expected following function declaration");2592 /* error("semicolon expected following function declaration"); */ 2593 2593 break; 2594 2594 } … … 2683 2683 2684 2684 case TOKeof: 2685 error("found EOF instead of initializer");2685 /* error("found EOF instead of initializer"); */ 2686 2686 break; 2687 2687 … … 2848 2848 //printf("parseStatement()\n"); 2849 2849 2850 if (flags & PScurly && token.value != TOKlcurly)2851 error("statement expected to be { }, not %s", token.toChars()); 2850 /* if (flags & PScurly && token.value != TOKlcurly) 2851 error("statement expected to be { }, not %s", token.toChars()); */ 2852 2852 2853 2853 switch (token.value) … … 3163 3163 } 3164 3164 at = parseType(&ai); 3165 if (!ai)3166 error("no identifier for declarator %s", at->toChars()); 3165 /* if (!ai) 3166 error("no identifier for declarator %s", at->toChars()); */ 3167 3167 Larg: 3168 3168 a = new Argument(storageClass, at, ai, NULL); … … 3651 3651 case TOKeof: 3652 3652 /* { */ 3653 error("matching '}' expected, not end of file");3653 /* error("matching '}' expected, not end of file"); */ 3654 3654 break; 3655 3655 … … 3672 3672 3673 3673 default: 3674 error("found '%s' instead of statement", token.toChars());3674 /* error("found '%s' instead of statement", token.toChars()); */ 3675 3675 goto Lerror; 3676 3676 … … 3696 3696 void Parser::check(Loc loc, enum TOK value) 3697 3697 { 3698 if (token.value != value)3699 error(loc, "found '%s' when expecting '%s'", token.toChars(), Token::toChars(value)); 3698 /* if (token.value != value) 3699 error(loc, "found '%s' when expecting '%s'", token.toChars(), Token::toChars(value)); */ 3700 3700 nextToken(); 3701 3701 } … … 3703 3703 void Parser::check(enum TOK value, const char *string) 3704 3704 { 3705 if (token.value != value)3705 /* if (token.value != value) 3706 3706 error("found '%s' when expecting '%s' following '%s'", 3707 token.toChars(), Token::toChars(value), string); 3707 token.toChars(), Token::toChars(value), string); */ 3708 3708 nextToken(); 3709 3709 } … … 4430 4430 check(TOKdot, t->toChars()); 4431 4431 if (token.value != TOKidentifier) 4432 { error("found '%s' when expecting identifier following '%s.'", token.toChars(), t->toChars());4432 { /* error("found '%s' when expecting identifier following '%s.'", token.toChars(), t->toChars()); */ 4433 4433 goto Lerr; 4434 4434 } … … 4733 4733 continue; 4734 4734 } 4735 else4736 error("identifier expected following '.', not '%s'", token.toChars()); 4735 /* else 4736 error("identifier expected following '.', not '%s'", token.toChars()); */ 4737 4737 break; 4738 4738 … … 4962 4962 nextToken(); 4963 4963 if (token.value != TOKidentifier) 4964 { error("Identifier expected following (type).");4964 { /* error("Identifier expected following (type)."); */ 4965 4965 return NULL; 4966 4966 } … … 5450 5450 5451 5451 if (token.value != TOKlcurly) 5452 { error("{ members } expected for anonymous class");5452 { /* error("{ members } expected for anonymous class"); */ 5453 5453 cd->members = NULL; 5454 5454 } … … 5457 5457 nextToken(); 5458 5458 Array *decl = parseDeclDefs(0); 5459 if (token.value != TOKrcurly)5460 error("class member expected"); 5459 /* if (token.value != TOKrcurly) 5460 error("class member expected"); */ 5461 5461 nextToken(); 5462 5462 cd->members = decl;
