Mercurial > projects > ldc
comparison dmd/parse.c @ 139:0ab29b838084 trunk
[svn r143] Fixed: a few bugs in debug information, still only line info, but should be correct files now :)
Fixed: tango.io.Console seems to be working now.
author | lindquist |
---|---|
date | Tue, 22 Jan 2008 00:01:16 +0100 |
parents | 70d6113eeb8c |
children | 5acec6b2eef8 |
comparison
equal
deleted
inserted
replaced
138:aeddd4d533b3 | 139:0ab29b838084 |
---|---|
1217 * Parse template parameter list. | 1217 * Parse template parameter list. |
1218 */ | 1218 */ |
1219 | 1219 |
1220 TemplateParameters *Parser::parseTemplateParameterList() | 1220 TemplateParameters *Parser::parseTemplateParameterList() |
1221 { | 1221 { |
1222 TemplateParameters *tpl; | 1222 TemplateParameters *tpl = new TemplateParameters(); |
1223 | 1223 |
1224 if (token.value != TOKlparen) | 1224 if (token.value != TOKlparen) |
1225 { error("parenthesized TemplateParameterList expected following TemplateIdentifier"); | 1225 { error("parenthesized TemplateParameterList expected following TemplateIdentifier"); |
1226 goto Lerr; | 1226 goto Lerr; |
1227 } | 1227 } |
1228 tpl = new TemplateParameters(); | |
1229 nextToken(); | 1228 nextToken(); |
1230 | 1229 |
1231 // Get array of TemplateParameters | 1230 // Get array of TemplateParameters |
1232 if (token.value != TOKrparen) | 1231 if (token.value != TOKrparen) |
1233 { int isvariadic = 0; | 1232 { int isvariadic = 0; |
1307 tp_valtype = parseBasicType(); | 1306 tp_valtype = parseBasicType(); |
1308 tp_valtype = parseDeclarator(tp_valtype, &tp_ident); | 1307 tp_valtype = parseDeclarator(tp_valtype, &tp_ident); |
1309 if (!tp_ident) | 1308 if (!tp_ident) |
1310 { | 1309 { |
1311 error("no identifier for template value parameter"); | 1310 error("no identifier for template value parameter"); |
1312 goto Lerr; | 1311 tp_ident = new Identifier("error", TOKidentifier); |
1313 } | 1312 } |
1314 if (token.value == TOKcolon) // : CondExpression | 1313 if (token.value == TOKcolon) // : CondExpression |
1315 { | 1314 { |
1316 nextToken(); | 1315 nextToken(); |
1317 tp_specvalue = parseCondExp(); | 1316 tp_specvalue = parseCondExp(); |
1328 break; | 1327 break; |
1329 nextToken(); | 1328 nextToken(); |
1330 } | 1329 } |
1331 } | 1330 } |
1332 check(TOKrparen); | 1331 check(TOKrparen); |
1332 Lerr: | |
1333 return tpl; | 1333 return tpl; |
1334 | |
1335 Lerr: | |
1336 return NULL; | |
1337 } | 1334 } |
1338 | 1335 |
1339 /****************************************** | 1336 /****************************************** |
1340 * Parse template mixin. | 1337 * Parse template mixin. |
1341 * mixin Foo; | 1338 * mixin Foo; |