Lines Matching refs:token

94     const utf8_t *comment = token.blockComment;  in parseModule()
101 if (skipAttributes(&token, &tk) && tk->value == TOKmodule) in parseModule()
103 while (token.value != TOKmodule) in parseModule()
105 switch (token.value) in parseModule()
119 if (token.value == TOKlparen) in parseModule()
135 … error("@%s attribute for module declaration is not supported", token.toChars()); in parseModule()
147 error("'module' expected instead of %s", token.toChars()); in parseModule()
163 if (token.value == TOKmodule) in parseModule()
165 Loc loc = token.loc; in parseModule()
168 if (token.value != TOKidentifier) in parseModule()
178 id = token.ident; in parseModule()
185 if (token.value != TOKidentifier) in parseModule()
190 id = token.ident; in parseModule()
197 if (token.value != TOKsemicolon) in parseModule()
198 error("';' expected following module declaration instead of %s", token.toChars()); in parseModule()
205 if (token.value != TOKeof) in parseModule()
207 error(token.loc, "unrecognized declaration"); in parseModule()
213 while (token.value != TOKsemicolon && token.value != TOKeof) in parseModule()
263 pAttrs->comment = token.blockComment; in parseDeclDefs()
271 switch (token.value) in parseDeclDefs()
278 Token *t = peek(&token); in parseDeclDefs()
306 Loc loc = token.loc; in parseDeclDefs()
374 Token *t = peek(&token); in parseDeclDefs()
384 error("invariant body expected, not '%s'", token.toChars()); in parseDeclDefs()
400 Loc loc = token.loc; in parseDeclDefs()
405 switch (token.value) in parseDeclDefs()
429 s = new UnitTestDeclaration(loc, token.loc, STCundefined, NULL); in parseDeclDefs()
443 error("declaration expected, not '%s'",token.toChars()); in parseDeclDefs()
449 error("declaration expected, not '%s'", token.toChars()); in parseDeclDefs()
465 if (token.value == TOKcolon) in parseDeclDefs()
470 lookingForElse = token.loc; in parseDeclDefs()
475 if (token.value == TOKelse) in parseDeclDefs()
477 Loc elseloc = token.loc; in parseDeclDefs()
491 s = parseForeachStaticDecl(token.loc, pLastDecl); in parseDeclDefs()
574 if (token.value == TOKidentifier && in parseDeclDefs()
575 skipParensIf(peek(&token), &tk) && in parseDeclDefs()
592 … if (token.value == TOKidentifier && skipParens(peek(&token), &tk) && skipAttributes(tk, &tk) && in parseDeclDefs()
629 if (peek(&token)->value != TOKlparen) in parseDeclDefs()
673 if (peek(&token)->value != TOKlparen) in parseDeclDefs()
679 Loc linkLoc = token.loc; in parseDeclDefs()
756 if (pAttrs->protection.kind == PROTpackage && token.value == TOKlparen) in parseDeclDefs()
764 while (token.value != TOKsemicolon && token.value != TOKeof) in parseDeclDefs()
771 Loc attrloc = token.loc; in parseDeclDefs()
787 const Loc attrLoc = token.loc; in parseDeclDefs()
792 if (token.value == TOKlparen) in parseDeclDefs()
826 Loc loc = token.loc; in parseDeclDefs()
830 if (token.value != TOKidentifier) in parseDeclDefs()
835 Identifier *ident = token.ident; in parseDeclDefs()
837 if (token.value == TOKcomma && peekNext() != TOKrparen) in parseDeclDefs()
843 if (token.value == TOKsemicolon) in parseDeclDefs()
862 if (token.value == TOKassign) in parseDeclDefs()
865 if (token.value == TOKidentifier) in parseDeclDefs()
866 s = new DebugSymbol(token.loc, token.ident); in parseDeclDefs()
867 else if (token.value == TOKint32v || token.value == TOKint64v) in parseDeclDefs()
868 s = new DebugSymbol(token.loc, (unsigned)token.uns64value); in parseDeclDefs()
871 error("identifier or integer expected, not %s", token.toChars()); in parseDeclDefs()
875 if (token.value != TOKsemicolon) in parseDeclDefs()
886 if (token.value == TOKassign) in parseDeclDefs()
889 if (token.value == TOKidentifier) in parseDeclDefs()
890 s = new VersionSymbol(token.loc, token.ident); in parseDeclDefs()
891 else if (token.value == TOKint32v || token.value == TOKint64v) in parseDeclDefs()
892 s = new VersionSymbol(token.loc, (unsigned)token.uns64value); in parseDeclDefs()
895 error("identifier or integer expected, not %s", token.toChars()); in parseDeclDefs()
899 if (token.value != TOKsemicolon) in parseDeclDefs()
910 if (token.value == TOKcolon) in parseDeclDefs()
915 lookingForElse = token.loc; in parseDeclDefs()
920 if (token.value == TOKelse) in parseDeclDefs()
922 Loc elseloc = token.loc; in parseDeclDefs()
937 error("declaration expected, not '%s'",token.toChars()); in parseDeclDefs()
939 while (token.value != TOKsemicolon && token.value != TOKeof) in parseDeclDefs()
992 error("conflicting attribute '%s'", Token::toChars(token.value)); in appendStorageClass()
998 error("conflicting attribute '%s'", Token::toChars(token.value)); in appendStorageClass()
1004 error("conflicting attribute '@%s'", token.toChars()); in appendStorageClass()
1026 if (token.value == TOKidentifier) in parseAttribute()
1028 if (token.ident == Id::property) in parseAttribute()
1030 else if (token.ident == Id::nogc) in parseAttribute()
1032 else if (token.ident == Id::safe) in parseAttribute()
1034 else if (token.ident == Id::trusted) in parseAttribute()
1036 else if (token.ident == Id::system) in parseAttribute()
1038 else if (token.ident == Id::disable) in parseAttribute()
1040 else if (token.ident == Id::future) in parseAttribute()
1046 if (token.value == TOKlparen) in parseAttribute()
1048 Loc loc = token.loc; in parseAttribute()
1056 else if (token.value == TOKlparen) in parseAttribute()
1066 error("@identifier or @(ArgumentList) expected, not @%s", token.toChars()); in parseAttribute()
1090 switch (token.value) in parsePostfix()
1134 if (peek(&token)->value == TOKlparen) in parseTypeCtor()
1138 switch (token.value) in parseTypeCtor()
1162 switch (token.value) in parseBlock()
1180 if (token.value != TOKrcurly) in parseBlock()
1183 error("matching '}' expected, not %s", token.toChars()); in parseBlock()
1210 Loc loc = token.loc; in parseStaticAssert()
1219 if (token.value == TOKcomma) in parseStaticAssert()
1222 if (token.value != TOKrparen) in parseStaticAssert()
1225 if (token.value == TOKcomma) in parseStaticAssert()
1242 Loc loc = token.loc; in parseTypeof()
1246 if (token.value == TOKreturn) // typeof(return) in parseTypeof()
1289 assert(token.value == TOKlparen); in parseLinkage()
1291 if (token.value == TOKidentifier) in parseLinkage()
1292 { Identifier *id = token.ident; in parseLinkage()
1304 if (token.value == TOKplusplus) in parseLinkage()
1308 if (token.value == TOKcomma) // , namespaces or class or struct in parseLinkage()
1311 if (token.value == TOKclass || token.value == TOKstruct) in parseLinkage()
1313 cppmangle = token.value == TOKclass ? CPPMANGLEclass : CPPMANGLEstruct; in parseLinkage()
1316 else if (token.value == TOKstring) // extern(C++, "namespace", "namespaces") in parseLinkage()
1338 if (token.value == TOKcomma) in parseLinkage()
1341 if (token.value != TOKstring) in parseLinkage()
1343 … error("string expected following `,` for C++ namespace, not `%s`", token.toChars()); in parseLinkage()
1357 if (token.value == TOKidentifier) in parseLinkage()
1359 Identifier *idn = token.ident; in parseLinkage()
1362 if (token.value == TOKdot) in parseLinkage()
1381 if (token.value == TOKmin) in parseLinkage()
1384 if (token.ident == Id::C) in parseLinkage()
1434 if (token.value != TOKidentifier) in parseQualifiedIdentifier()
1437 entity, token.toChars()); in parseQualifiedIdentifier()
1441 Identifier *id = token.ident; in parseQualifiedIdentifier()
1447 } while (token.value == TOKdot); in parseQualifiedIdentifier()
1460 if (token.value == TOKlparen) in parseDebugCondition()
1466 if (token.value == TOKidentifier) in parseDebugCondition()
1467 id = token.ident; in parseDebugCondition()
1468 else if (token.value == TOKint32v || token.value == TOKint64v) in parseDebugCondition()
1469 level = (unsigned)token.uns64value; in parseDebugCondition()
1471 error("identifier or integer expected, not %s", token.toChars()); in parseDebugCondition()
1492 if (token.value == TOKlparen) in parseVersionCondition()
1500 if (token.value == TOKidentifier) in parseVersionCondition()
1501 id = token.ident; in parseVersionCondition()
1502 else if (token.value == TOKint32v || token.value == TOKint64v) in parseVersionCondition()
1503 level = (unsigned)token.uns64value; in parseVersionCondition()
1504 else if (token.value == TOKunittest) in parseVersionCondition()
1506 else if (token.value == TOKassert) in parseVersionCondition()
1509 error("identifier or integer expected, not %s", token.toChars()); in parseVersionCondition()
1533 Loc loc = token.loc; in parseStaticIfCondition()
1537 if (token.value == TOKlparen) in parseStaticIfCondition()
1566 Loc loc = token.loc; in parseCtor()
1570 if (token.value == TOKlparen && peekNext() == TOKthis && peekNext2() == TOKrparen) in parseCtor()
1599 if (token.value == TOKlparen && peekPastParen(&token)->value == TOKlparen) in parseCtor()
1658 Loc loc = token.loc; in parseDtor()
1697 Loc loc = token.loc; in parseStaticCtor()
1734 Loc loc = token.loc; in parseStaticDtor()
1778 Loc loc = token.loc; in parseSharedStaticCtor()
1814 Loc loc = token.loc; in parseSharedStaticDtor()
1856 Loc loc = token.loc; in parseInvariant()
1860 if (token.value == TOKlparen) // optional () in parseInvariant()
1881 Loc loc = token.loc; in parseUnitTest()
1886 const utf8_t *begPtr = token.ptr + 1; // skip '{' in parseUnitTest()
1912 UnitTestDeclaration *f = new UnitTestDeclaration(loc, token.loc, stc, docline); in parseUnitTest()
1927 Loc loc = token.loc; in parseNew()
1949 Loc loc = token.loc; in parseDelete()
1986 switch (token.value) in parseParameters()
1997 if (peek(&token)->value == TOKlparen) in parseParameters()
2003 if (peek(&token)->value == TOKlparen) in parseParameters()
2009 if (peek(&token)->value == TOKlparen) in parseParameters()
2015 if (peek(&token)->value == TOKlparen) in parseParameters()
2043 if (tpl && token.value == TOKidentifier && in parseParameters()
2044 (t = peek(&token), (t->value == TOKcomma || in parseParameters()
2049 Loc loc = token.loc; in parseParameters()
2056 ai = token.ident; in parseParameters()
2062 if (token.value == TOKassign) // = defaultArg in parseParameters()
2072 if (token.value == TOKdotdotdot) in parseParameters()
2085 if (token.value == TOKcomma) in parseParameters()
2112 Loc loc = token.loc; in parseEnum()
2116 if (token.value == TOKidentifier) in parseEnum()
2118 id = token.ident; in parseEnum()
2124 if (token.value == TOKcolon) in parseEnum()
2129 Loc typeLoc = token.loc; in parseEnum()
2138 if (token.value == TOKsemicolon && id) in parseEnum()
2140 else if (token.value == TOKlcurly) in parseEnum()
2145 const utf8_t *comment = token.blockComment; in parseEnum()
2146 while (token.value != TOKrcurly) in parseEnum()
2154 loc = token.loc; in parseEnum()
2158 Token *tp = peek(&token); in parseEnum()
2159 if (token.value == TOKidentifier && in parseEnum()
2162 ident = token.ident; in parseEnum()
2176 if (token.value == TOKassign) in parseEnum()
2191 if (token.value == TOKrcurly) in parseEnum()
2200 comment = token.blockComment; in parseEnum()
2202 if (token.value == TOKeof) in parseEnum()
2228 Loc loc = token.loc; in parseAggregate()
2229 TOK tok = token.value; in parseAggregate()
2233 if (token.value != TOKidentifier) in parseAggregate()
2239 id = token.ident; in parseAggregate()
2242 if (token.value == TOKlparen) in parseAggregate()
2261 if (token.value == TOKcolon) in parseAggregate()
2278 if (token.value != TOKlcurly) in parseAggregate()
2313 if (a && token.value == TOKsemicolon) in parseAggregate()
2317 else if (token.value == TOKlcurly) in parseAggregate()
2325 if (token.value != TOKrcurly) in parseAggregate()
2368 switch (token.value) in parseBaseClasses()
2396 if (token.value != TOKcomma) in parseBaseClasses()
2411 if (token.value == TOKif) in parseConstraint()
2432 Loc loc = token.loc; in parseTemplateDeclaration()
2435 if (token.value != TOKidentifier) in parseTemplateDeclaration()
2440 id = token.ident; in parseTemplateDeclaration()
2448 if (token.value != TOKlcurly) in parseTemplateDeclaration()
2474 if (!flag && token.value != TOKlparen) in parseTemplateParameterList()
2481 if (flag || token.value != TOKrparen) in parseTemplateParameterList()
2484 while (token.value != TOKrparen) in parseTemplateParameterList()
2499 t = peek(&token); in parseTemplateParameterList()
2500 if (token.value == TOKalias) in parseTemplateParameterList()
2503 loc = token.loc; // todo in parseTemplateParameterList()
2505 if (isDeclaration(&token, 2, TOKreserved, NULL)) in parseTemplateParameterList()
2511 if (token.value != TOKidentifier) in parseTemplateParameterList()
2516 tp_ident = token.ident; in parseTemplateParameterList()
2520 if (token.value == TOKcolon) // : Type in parseTemplateParameterList()
2523 if (isDeclaration(&token, 0, TOKreserved, NULL)) in parseTemplateParameterList()
2529 if (token.value == TOKassign) // = Type in parseTemplateParameterList()
2532 if (isDeclaration(&token, 0, TOKreserved, NULL)) in parseTemplateParameterList()
2543 if (token.value != TOKidentifier) in parseTemplateParameterList()
2548 loc = token.loc; in parseTemplateParameterList()
2549 tp_ident = token.ident; in parseTemplateParameterList()
2551 if (token.value == TOKcolon) // : Type in parseTemplateParameterList()
2556 if (token.value == TOKassign) // = Type in parseTemplateParameterList()
2563 else if (token.value == TOKidentifier && t->value == TOKdotdotdot) in parseTemplateParameterList()
2569 loc = token.loc; in parseTemplateParameterList()
2570 tp_ident = token.ident; in parseTemplateParameterList()
2575 else if (token.value == TOKthis) in parseTemplateParameterList()
2579 if (token.value != TOKidentifier) in parseTemplateParameterList()
2584 loc = token.loc; in parseTemplateParameterList()
2585 tp_ident = token.ident; in parseTemplateParameterList()
2587 if (token.value == TOKcolon) // : Type in parseTemplateParameterList()
2592 if (token.value == TOKassign) // = Type in parseTemplateParameterList()
2602 loc = token.loc; // todo in parseTemplateParameterList()
2609 if (token.value == TOKcolon) // : CondExpression in parseTemplateParameterList()
2614 if (token.value == TOKassign) // = CondExpression in parseTemplateParameterList()
2622 if (token.value != TOKcomma) in parseTemplateParameterList()
2648 Loc locMixin = token.loc; in parseMixin()
2651 Loc loc = token.loc; in parseMixin()
2653 if (token.value == TOKdot) in parseMixin()
2659 if (token.value == TOKtypeof) in parseMixin()
2664 if (token.value != TOKidentifier) in parseMixin()
2666 error("identifier expected, not %s", token.toChars()); in parseMixin()
2670 id = token.ident; in parseMixin()
2677 if (token.value == TOKnot) in parseMixin()
2682 if (tiargs && token.value == TOKdot) in parseMixin()
2700 if (token.value != TOKdot) in parseMixin()
2704 if (token.value != TOKidentifier) in parseMixin()
2706 error("identifier expected following '.' instead of '%s'", token.toChars()); in parseMixin()
2709 loc = token.loc; in parseMixin()
2710 id = token.ident; in parseMixin()
2714 if (token.value == TOKidentifier) in parseMixin()
2716 id = token.ident; in parseMixin()
2723 if (token.value != TOKsemicolon) in parseMixin()
2743 if (token.value == TOKlparen) in parseTemplateArguments()
2753 if (token.value == TOKnot) in parseTemplateArguments()
2761 if (token.value == TOKlparen) in parseTemplateArguments()
2765 if (token.value == TOKnot && (tok = peekNext()) != TOKis && tok != TOKin) in parseTemplateArguments()
2786 assert(token.value == TOKlparen || token.value == TOKcomma); in parseTemplateArgumentList()
2790 while (token.value != endtok) in parseTemplateArgumentList()
2793 if (isDeclaration(&token, 0, TOKreserved, NULL)) in parseTemplateArgumentList()
2803 if (token.value != TOKcomma) in parseTemplateArgumentList()
2823 switch (token.value) in parseTemplateSingleArgument()
2826 ta = new TypeIdentifier(token.loc, token.ident); in parseTemplateSingleArgument()
2907 int isstatic = token.value == TOKstatic; in parseImport()
2916 if (token.value != TOKidentifier) in parseImport()
2922 Loc loc = token.loc; in parseImport()
2923 Identifier *id = token.ident; in parseImport()
2926 if (!aliasid && token.value == TOKassign) in parseImport()
2931 while (token.value == TOKdot) in parseImport()
2937 if (token.value != TOKidentifier) in parseImport()
2942 id = token.ident; in parseImport()
2953 if (token.value == TOKcolon) in parseImport()
2958 if (token.value != TOKidentifier) in parseImport()
2963 Identifier *alias = token.ident; in parseImport()
2966 if (token.value == TOKassign) in parseImport()
2969 if (token.value != TOKidentifier) in parseImport()
2974 name = token.ident; in parseImport()
2983 } while (token.value == TOKcomma); in parseImport()
2988 } while (token.value == TOKcomma); in parseImport()
2990 if (token.value == TOKsemicolon) in parseImport()
3017 switch (token.value) in parseType()
3053 Loc typeLoc = token.loc; in parseType()
3073 switch (token.value) in parseBasicType()
3085 if (token.value == TOKint64) // if `long long` in parseBasicType()
3090 else if (token.value == TOKfloat64) // if `long double` in parseBasicType()
3122 loc = token.loc; in parseBasicType()
3123 id = token.ident; in parseBasicType()
3125 if (token.value == TOKnot) in parseBasicType()
3140 … t = parseBasicTypeStartingAt(new TypeIdentifier(token.loc, Id::empty), dontLookDotIdents); in parseBasicType()
3157 t = new TypeTraits(token.loc, te); in parseBasicType()
3197 error("basic type expected, not %s", token.toChars()); in parseBasicType()
3216 switch (token.value) in parseBasicTypeStartingAt()
3221 if (token.value != TOKidentifier) in parseBasicTypeStartingAt()
3223 error("identifier expected following '.' instead of '%s'", token.toChars()); in parseBasicTypeStartingAt()
3263 Loc loc = token.loc; in parseBasicTypeStartingAt()
3264 Identifier *id = token.ident; in parseBasicTypeStartingAt()
3266 if (token.value == TOKnot) in parseBasicTypeStartingAt()
3283 if (token.value == TOKrbracket) in parseBasicTypeStartingAt()
3291 else if (isDeclaration(&token, 0, TOKrbracket, NULL)) in parseBasicTypeStartingAt()
3311 if (token.value == TOKslice) in parseBasicTypeStartingAt()
3355 switch (token.value) in parseBasicType2()
3367 if (token.value == TOKrbracket) in parseBasicType2()
3372 else if (isDeclaration(&token, 0, TOKrbracket, NULL)) in parseBasicType2()
3385 if (token.value == TOKslice) in parseBasicType2()
3406 TOK save = token.value; in parseBasicType2()
3445 switch (token.value) in parseDeclarator()
3449 *pident = token.ident; in parseDeclarator()
3451 error("unexpected identifer '%s' in declarator", token.ident->toChars()); in parseDeclarator()
3476 Token *peekt = &token; in parseDeclarator()
3499 switch (token.value) in parseDeclarator()
3512 if (token.value == TOKrbracket) in parseDeclarator()
3519 else if (isDeclaration(&token, 0, TOKrbracket, NULL)) in parseDeclarator()
3553 Token *tk = peekPastParen(&token); in parseDeclarator()
3614 switch (token.value) in parseStorageClasses()
3617 if (peek(&token)->value == TOKlparen) in parseStorageClasses()
3623 if (peek(&token)->value == TOKlparen) in parseStorageClasses()
3629 if (peek(&token)->value == TOKlparen) in parseStorageClasses()
3635 if (peek(&token)->value == TOKlparen) in parseStorageClasses()
3667 if (peek(&token)->value != TOKlparen) in parseStorageClasses()
3696 if (token.value == TOKlparen) in parseStorageClasses()
3730 Loc loc = token.loc; in parseDeclarations()
3736 comment = token.blockComment; in parseDeclarations()
3744 if (token.value == TOKalias) in parseDeclarations()
3746 tok = token.value; in parseDeclarations()
3752 if (token.value == TOKidentifier && peekNext() == TOKthis) in parseDeclarations()
3754 AliasThis *s = new AliasThis(loc, token.ident); in parseDeclarations()
3767 if (token.value == TOKidentifier && in parseDeclarations()
3768 skipParensIf(peek(&token), &tk) && in parseDeclarations()
3774 ident = token.ident; in parseDeclarations()
3777 if (token.value == TOKlparen) in parseDeclarations()
3782 if (token.value == TOKfunction || in parseDeclarations()
3783 token.value == TOKdelegate || in parseDeclarations()
3784 (token.value == TOKlparen && in parseDeclarations()
3785 skipAttributes(peekPastParen(&token), &tk) && in parseDeclarations()
3787 token.value == TOKlcurly || in parseDeclarations()
3788 (token.value == TOKidentifier && peekNext() == TOKgoesto)) in parseDeclarations()
3842 switch (token.value) in parseDeclarations()
3851 if (token.value != TOKidentifier) in parseDeclarations()
3853 error("identifier expected following comma, not %s", token.toChars()); in parseDeclarations()
3877 if (token.value == TOKstruct || in parseDeclarations()
3878 token.value == TOKunion || in parseDeclarations()
3879 token.value == TOKclass || in parseDeclarations()
3880 token.value == TOKinterface) in parseDeclarations()
3920 token.value == TOKidentifier && in parseDeclarations()
3921 skipParensIf(peek(&token), &tk) && in parseDeclarations()
3936 if ((storage_class || udas) && token.value == TOKidentifier && skipParens(peek(&token), &tk) && in parseDeclarations()
3965 loc = token.loc; in parseDeclarations()
3974 …bool isThis = (t->ty == Tident && ((TypeIdentifier *)t)->ident == Id::This && token.value == TOKas… in parseDeclarations()
3995 if (token.value == TOKassign) in parseDeclarations()
4030 switch (token.value) in parseDeclarations()
4100 if (token.value == TOKassign) in parseDeclarations()
4134 switch (token.value) in parseDeclarations()
4147 error("semicolon expected, not '%s'", token.toChars()); in parseDeclarations()
4158 Loc loc = token.loc; in parseFunctionLiteral()
4167 switch (token.value) in parseFunctionLiteral()
4171 save = token.value; in parseFunctionLiteral()
4173 if (token.value != TOKlparen && token.value != TOKlcurly) in parseFunctionLiteral()
4181 if (token.value == TOKlparen) in parseFunctionLiteral()
4223 parameters->push(new Parameter(0, t, token.ident, NULL)); in parseFunctionLiteral()
4242 if (token.value == TOKgoesto) in parseFunctionLiteral()
4245 Loc returnloc = token.loc; in parseFunctionLiteral()
4248 fd->endloc = token.loc; in parseFunctionLiteral()
4282 Loc loc = token.loc; in parseAutoDeclarations()
4283 Identifier *ident = token.ident; in parseAutoDeclarations()
4287 if (token.value == TOKlparen) in parseAutoDeclarations()
4305 switch (token.value) in parseAutoDeclarations()
4314 if (!(token.value == TOKidentifier && in parseAutoDeclarations()
4315 skipParensIf(peek(&token), &tk) && in parseAutoDeclarations()
4325 error("semicolon expected following auto declaration, not '%s'", token.toChars()); in parseAutoDeclarations()
4347 switch (token.value) in parseContracts()
4357 if (token.ident != Id::_body) in parseContracts()
4377 if (token.value != TOKlcurly) in parseContracts()
4380 if (token.value != TOKidentifier) in parseContracts()
4381 error("(identifier) following 'out' expected, not %s", token.toChars()); in parseContracts()
4382 f->outId = token.ident; in parseContracts()
4439 Loc loc = token.loc; in parseInitializer()
4444 switch (token.value) in parseInitializer()
4453 for (t = peek(&token); 1; t = peek(t)) in parseInitializer()
4484 switch (token.value) in parseInitializer()
4489 t = peek(&token); in parseInitializer()
4492 id = token.ident; in parseInitializer()
4539 for (t = peek(&token); 1; t = peek(t)) in parseInitializer()
4573 switch (token.value) in parseInitializer()
4577 … { error("comma expected separating array initializers, not %s", token.toChars()); in parseInitializer()
4584 if (token.value == TOKcolon) in parseInitializer()
4600 … error("comma expected separating array initializers, not %s", token.toChars()); in parseInitializer()
4602 if (token.value == TOKcolon) in parseInitializer()
4626 error("found '%s' instead of array initializer", token.toChars()); in parseInitializer()
4634 t = peek(&token); in parseInitializer()
4657 if (token.value == TOKfile || in parseDefaultInitExp()
4658 token.value == TOKfilefullpath || in parseDefaultInitExp()
4659 token.value == TOKline || in parseDefaultInitExp()
4660 token.value == TOKmodulestring || in parseDefaultInitExp()
4661 token.value == TOKfuncstring || in parseDefaultInitExp()
4662 token.value == TOKprettyfunc) in parseDefaultInitExp()
4664 Token *t = peek(&token); in parseDefaultInitExp()
4668 if (token.value == TOKfile) in parseDefaultInitExp()
4669 e = new FileInitExp(token.loc, TOKfile); in parseDefaultInitExp()
4670 else if (token.value == TOKfilefullpath) in parseDefaultInitExp()
4671 e = new FileInitExp(token.loc, TOKfilefullpath); in parseDefaultInitExp()
4672 else if (token.value == TOKline) in parseDefaultInitExp()
4673 e = new LineInitExp(token.loc); in parseDefaultInitExp()
4674 else if (token.value == TOKmodulestring) in parseDefaultInitExp()
4675 e = new ModuleInitExp(token.loc); in parseDefaultInitExp()
4676 else if (token.value == TOKfuncstring) in parseDefaultInitExp()
4677 e = new FuncInitExp(token.loc); in parseDefaultInitExp()
4678 else if (token.value == TOKprettyfunc) in parseDefaultInitExp()
4679 e = new PrettyFuncInitExp(token.loc); in parseDefaultInitExp()
4696 if (token.value != TOKelse && in checkDanglingElse()
4697 token.value != TOKcatch && in checkDanglingElse()
4698 token.value != TOKfinally && in checkDanglingElse()
4728 TOK op = token.value; in parseForeach()
4748 switch (token.value) in parseForeach()
4798 if (token.value == TOKidentifier) in parseForeach()
4800 Token *t = peek(&token); in parseForeach()
4802 { ai = token.ident; in parseForeach()
4814 if (token.value == TOKcomma) in parseForeach()
4823 if (token.value == TOKslice && parameters->dim == 1) in parseForeach()
4888 Loc loc = token.loc; in parseStatement()
4892 if (flags & PScurly && token.value != TOKlcurly) in parseStatement()
4893 error("statement expected to be { }, not %s", token.toChars()); in parseStatement()
4895 switch (token.value) in parseStatement()
4901 Token *t = peek(&token); in parseStatement()
4915 Identifier *ident = token.ident; in parseStatement()
4918 if (token.value == TOKrcurly) in parseStatement()
4920 else if (token.value == TOKlcurly) in parseStatement()
4936 if (isDeclaration(&token, 3, TOKreserved, NULL)) in parseStatement()
4998 Token *t = peek(&token); in parseStatement()
5013 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5021 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5096 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5105 Token *t = peek(&token); in parseStatement()
5121 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5126 { Token *t = peek(&token); in parseStatement()
5145 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5158 while (token.value != TOKrcurly && token.value != TOKeof) in parseStatement()
5162 if (endPtr) *endPtr = token.ptr; in parseStatement()
5163 endloc = token.loc; in parseStatement()
5166 *pEndloc = token.loc; in parseStatement()
5171 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5214 if (token.value == TOKsemicolon) in parseStatement()
5218 s = new DoStatement(loc, body, condition, token.loc); in parseStatement()
5230 if (token.value == TOKsemicolon) in parseStatement()
5241 if (token.value == TOKsemicolon) in parseStatement()
5251 if (token.value == TOKrparen) in parseStatement()
5288 switch (token.value) in parseStatement()
5329 token.value == TOKidentifier && in parseStatement()
5330 peek(&token)->value == TOKassign) in parseStatement()
5332 Identifier *ai = token.ident; in parseStatement()
5338 else if (isDeclaration(&token, 2, TOKassign, NULL)) in parseStatement()
5354 if (token.value == TOKelse) in parseStatement()
5356 Loc elseloc = token.loc; in parseStatement()
5364 s = new IfStatement(loc, param, condition, ifbody, elsebody, token.loc); in parseStatement()
5371 if (peek(&token)->value != TOKlparen) in parseStatement()
5375 if (token.value != TOKidentifier) in parseStatement()
5381 Identifier *id = token.ident; in parseStatement()
5400 if (token.value == TOKassign) in parseStatement()
5412 if (token.value == TOKassign) in parseStatement()
5430 if (token.value == TOKelse) in parseStatement()
5432 Loc elseloc = token.loc; in parseStatement()
5439 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5449 if (token.value != TOKidentifier) in parseStatement()
5453 ident = token.ident; in parseStatement()
5455 if (token.value == TOKcomma && peekNext() != TOKrparen) in parseStatement()
5459 if (token.value == TOKsemicolon) in parseStatement()
5494 if (token.value != TOKcomma) in parseStatement()
5501 if (token.value == TOKslice) in parseStatement()
5514 while (token.value != TOKcase && in parseStatement()
5515 token.value != TOKdefault && in parseStatement()
5516 token.value != TOKeof && in parseStatement()
5517 token.value != TOKrcurly) in parseStatement()
5525 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5551 while (token.value != TOKcase && in parseStatement()
5552 token.value != TOKdefault && in parseStatement()
5553 token.value != TOKeof && in parseStatement()
5554 token.value != TOKrcurly) in parseStatement()
5562 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5571 if (token.value == TOKsemicolon) in parseStatement()
5584 if (token.value == TOKidentifier) in parseStatement()
5585 { ident = token.ident; in parseStatement()
5599 if (token.value == TOKidentifier) in parseStatement()
5600 { ident = token.ident; in parseStatement()
5614 if (token.value == TOKdefault) in parseStatement()
5619 else if (token.value == TOKcase) in parseStatement()
5624 if (token.value != TOKsemicolon) in parseStatement()
5630 if (token.value != TOKidentifier) in parseStatement()
5637 ident = token.ident; in parseStatement()
5650 Token *t = peek(&token); in parseStatement()
5655 if (token.value == TOKlparen) in parseStatement()
5677 s = new WithStatement(loc, exp, body, token.loc); in parseStatement()
5691 while (token.value == TOKcatch) in parseStatement()
5697 Loc catchloc = token.loc; in parseStatement()
5700 if (token.value == TOKlcurly || token.value != TOKlparen) in parseStatement()
5719 if (token.value == TOKfinally) in parseStatement()
5769 switch (token.value) in parseStatement()
5775 Token *t = peek(&token); in parseStatement()
5778 label = token.ident; in parseStatement()
5779 labelloc = token.loc; in parseStatement()
5812 s = new AsmStatement(token.loc, toklist); in parseStatement()
5833 memcpy(*ptoklist, &token, sizeof(Token)); in parseStatement()
5852 s = new ScopeStatement(loc, s, token.loc); in parseStatement()
5864 error("found '%s' instead of statement", token.toChars()); in parseStatement()
5868 while (token.value != TOKrcurly && in parseStatement()
5869 token.value != TOKsemicolon && in parseStatement()
5870 token.value != TOKeof) in parseStatement()
5872 if (token.value == TOKsemicolon) in parseStatement()
5878 *pEndloc = token.loc; in parseStatement()
5884 check(token.loc, value); in check()
5889 if (token.value != value) in check()
5890 error(loc, "found '%s' when expecting '%s'", token.toChars(), Token::toChars(value)); in check()
5896 if (token.value != value) in check()
5898 token.toChars(), Token::toChars(value), string); in check()
6697 Loc loc = token.loc; in parsePrimaryExp()
6700 switch (token.value) in parsePrimaryExp()
6704 Token *t1 = peek(&token); in parsePrimaryExp()
6719 id = token.ident; in parsePrimaryExp()
6722 if (token.value == TOKnot && (save = peekNext()) != TOKis && save != TOKin) in parsePrimaryExp()
6758 e = new IntegerExp(loc, (d_int32)token.int64value, Type::tint32); in parsePrimaryExp()
6763 e = new IntegerExp(loc, (d_uns32)token.uns64value, Type::tuns32); in parsePrimaryExp()
6768 e = new IntegerExp(loc, token.int64value, Type::tint64); in parsePrimaryExp()
6773 e = new IntegerExp(loc, token.uns64value, Type::tuns64); in parsePrimaryExp()
6778 e = new RealExp(loc, token.floatvalue, Type::tfloat32); in parsePrimaryExp()
6783 e = new RealExp(loc, token.floatvalue, Type::tfloat64); in parsePrimaryExp()
6788 e = new RealExp(loc, token.floatvalue, Type::tfloat80); in parsePrimaryExp()
6793 e = new RealExp(loc, token.floatvalue, Type::timaginary32); in parsePrimaryExp()
6798 e = new RealExp(loc, token.floatvalue, Type::timaginary64); in parsePrimaryExp()
6803 e = new RealExp(loc, token.floatvalue, Type::timaginary80); in parsePrimaryExp()
6867 e = new IntegerExp(loc, (d_uns8)token.uns64value, Type::tchar); in parsePrimaryExp()
6872 e = new IntegerExp(loc, (d_uns16)token.uns64value, Type::twchar); in parsePrimaryExp()
6877 e = new IntegerExp(loc, (d_uns32)token.uns64value, Type::tdchar); in parsePrimaryExp()
6885 utf8_t *s = token.ustring; in parsePrimaryExp()
6886 size_t len = token.len; in parsePrimaryExp()
6887 unsigned char postfix = token.postfix; in parsePrimaryExp()
6890 const Token prev = token; in parsePrimaryExp()
6892 if (token.value == TOKstring || in parsePrimaryExp()
6893 token.value == TOKxstring) in parsePrimaryExp()
6895 if (token.postfix) in parsePrimaryExp()
6896 { if (token.postfix != postfix) in parsePrimaryExp()
6897 … error("mismatched string literal postfixes '%c' and '%c'", postfix, token.postfix); in parsePrimaryExp()
6898 postfix = token.postfix; in parsePrimaryExp()
6902 prev.toChars(), token.toChars()); in parsePrimaryExp()
6905 size_t len2 = token.len; in parsePrimaryExp()
6909 memcpy(s2 + len1, token.ustring, (len2 + 1) * sizeof(utf8_t)); in parsePrimaryExp()
6945 if (token.value == TOKlparen) in parsePrimaryExp()
6952 if (token.value != TOKidentifier) in parsePrimaryExp()
6953 … { error("found '%s' when expecting identifier following '%s.'", token.toChars(), t->toChars()); in parsePrimaryExp()
6956 e = typeDotIdExp(loc, t, token.ident); in parsePrimaryExp()
6979 if (isDeclaration(&token, 0, TOKreserved, NULL)) in parsePrimaryExp()
7000 if (token.value != TOKidentifier) in parsePrimaryExp()
7004 ident = token.ident; in parsePrimaryExp()
7006 if (token.value == TOKcomma) in parsePrimaryExp()
7025 if (token.value == TOKlparen) in parsePrimaryExp()
7029 if (token.value == TOKcolon || token.value == TOKequal) in parsePrimaryExp()
7031 tok = token.value; in parsePrimaryExp()
7034 (token.value == TOKstruct || in parsePrimaryExp()
7035 token.value == TOKunion || in parsePrimaryExp()
7036 token.value == TOKclass || in parsePrimaryExp()
7037 token.value == TOKsuper || in parsePrimaryExp()
7038 token.value == TOKenum || in parsePrimaryExp()
7039 token.value == TOKinterface || in parsePrimaryExp()
7040 token.value == TOKargTypes || in parsePrimaryExp()
7041 token.value == TOKparameters || in parsePrimaryExp()
7042 (token.value == TOKconst && peek(&token)->value == TOKrparen) || in parsePrimaryExp()
7043 (token.value == TOKimmutable && peek(&token)->value == TOKrparen) || in parsePrimaryExp()
7044 (token.value == TOKshared && peek(&token)->value == TOKrparen) || in parsePrimaryExp()
7045 (token.value == TOKwild && peek(&token)->value == TOKrparen) || in parsePrimaryExp()
7046 token.value == TOKfunction || in parsePrimaryExp()
7047 token.value == TOKdelegate || in parsePrimaryExp()
7048 token.value == TOKreturn || in parsePrimaryExp()
7049 (token.value == TOKvector && peek(&token)->value == TOKrparen))) in parsePrimaryExp()
7051 tok2 = token.value; in parsePrimaryExp()
7061 if (token.value == TOKcomma) in parsePrimaryExp()
7087 if (token.value == TOKcomma) in parsePrimaryExp()
7090 if (token.value != TOKrparen) in parsePrimaryExp()
7093 if (token.value == TOKcomma) in parsePrimaryExp()
7128 Token *tk = peekPastParen(&token); in parsePrimaryExp()
7154 while (token.value != TOKrbracket && token.value != TOKeof) in parsePrimaryExp()
7157 if (token.value == TOKcolon && (keys || values->dim == 0)) in parsePrimaryExp()
7170 if (token.value == TOKrbracket) in parsePrimaryExp()
7194 error("expression expected, not '%s'", token.toChars()); in parsePrimaryExp()
7210 loc = token.loc; in parsePostExp()
7211 switch (token.value) in parsePostExp()
7215 if (token.value == TOKidentifier) in parsePostExp()
7216 { Identifier *id = token.ident; in parsePostExp()
7219 if (token.value == TOKnot && peekNext() != TOKis && peekNext() != TOKin) in parsePostExp()
7228 else if (token.value == TOKnew) in parsePostExp()
7234 error("identifier expected following '.', not '%s'", token.toChars()); in parsePostExp()
7260 while (token.value != TOKrbracket && token.value != TOKeof) in parsePostExp()
7263 if (token.value == TOKslice) in parsePostExp()
7272 if (token.value == TOKrbracket) in parsePostExp()
7292 Loc loc = token.loc; in parseUnaryExp()
7294 switch (token.value) in parseUnaryExp()
7362 switch (token.value) in parseUnaryExp()
7397 if (token.value == TOKrparen) in parseUnaryExp()
7423 if (stc == 0 && token.value == TOKdot) in parseUnaryExp()
7426 if (token.value != TOKidentifier) in parseUnaryExp()
7431 e = typeDotIdExp(loc, t, token.ident); in parseUnaryExp()
7436 else if (token.value != TOKlparen) in parseUnaryExp()
7449 tk = peek(&token); in parseUnaryExp()
7522 if (token.value == TOKdot) in parseUnaryExp()
7558 while (token.value == TOKpow) in parseUnaryExp()
7572 Loc loc = token.loc; in parseMulExp()
7577 switch (token.value) in parseMulExp()
7595 Loc loc = token.loc; in parseAddExp()
7600 switch (token.value) in parseAddExp()
7618 Loc loc = token.loc; in parseShiftExp()
7623 switch (token.value) in parseShiftExp()
7642 Loc loc = token.loc; in parseCmpExp()
7645 TOK op = token.value; in parseCmpExp()
7662 t = peek(&token); in parseCmpExp()
7715 Loc loc = token.loc; in parseAndExp()
7718 while (token.value == TOKand) in parseAndExp()
7725 loc = token.loc; in parseAndExp()
7732 Loc loc = token.loc; in parseXorExp()
7735 while (token.value == TOKxor) in parseXorExp()
7748 Loc loc = token.loc; in parseOrExp()
7751 while (token.value == TOKor) in parseOrExp()
7766 Loc loc = token.loc; in parseAndAndExp()
7769 while (token.value == TOKandand) in parseAndAndExp()
7782 Loc loc = token.loc; in parseOrOrExp()
7785 while (token.value == TOKoror) in parseOrOrExp()
7799 Loc loc = token.loc; in parseCondExp()
7802 if (token.value == TOKquestion) in parseCondExp()
7822 loc = token.loc; in parseAssignExp()
7823 switch (token.value) in parseAssignExp()
7851 Loc loc = token.loc; in parseExpression()
7855 while (token.value == TOKcomma) in parseExpression()
7860 loc = token.loc; in parseExpression()
7878 if (token.value == TOKlbracket) in parseArguments()
7885 while (token.value != endtok && token.value != TOKeof) in parseArguments()
7889 if (token.value == endtok) in parseArguments()
7906 Loc loc = token.loc; in parseNewExp()
7910 if (token.value == TOKlparen) in parseNewExp()
7916 if (token.value == TOKclass) in parseNewExp()
7919 if (token.value == TOKlparen) in parseNewExp()
7923 if (token.value != TOKlcurly) in parseNewExp()
7929 if (token.value != TOKlcurly) in parseNewExp()
7937 if (token.value != TOKrcurly) in parseNewExp()
7968 else if (token.value == TOKlparen) in parseNewExp()
7981 s->addComment(combineComments(blockComment, token.lineComment)); in addComment()
7982 token.lineComment = NULL; in addComment()