Mercurial > projects > ddmd
comparison dmd/Parser.d @ 94:3a0b150c9841
Objects -> Vector!Object iteration 1
author | Eldar Insafutdinov <e.insafutdinov@gmail.com> |
---|---|
date | Mon, 30 Aug 2010 23:00:34 +0100 |
parents | be2ab491772e |
children | 12c0c84d13fd |
comparison
equal
deleted
inserted
replaced
93:df6d0f967680 | 94:3a0b150c9841 |
---|---|
1200 { | 1200 { |
1201 // See if it is an Expression or a Type | 1201 // See if it is an Expression or a Type |
1202 if (isDeclaration(&token, 0, TOKreserved, null)) | 1202 if (isDeclaration(&token, 0, TOKreserved, null)) |
1203 { // Template argument is a type | 1203 { // Template argument is a type |
1204 Type ta = parseType(); | 1204 Type ta = parseType(); |
1205 tiargs.push(cast(void*)ta); | 1205 tiargs.push(ta); |
1206 } | 1206 } |
1207 else | 1207 else |
1208 { // Template argument is an expression | 1208 { // Template argument is an expression |
1209 Expression ea = parseAssignExp(); | 1209 Expression ea = parseAssignExp(); |
1210 | 1210 |
1249 // Wrap a template around function fd | 1249 // Wrap a template around function fd |
1250 auto decldefs = new Dsymbols(); | 1250 auto decldefs = new Dsymbols(); |
1251 decldefs.push(fd); | 1251 decldefs.push(fd); |
1252 auto tempdecl = new TemplateDeclaration(fd.loc, fd.ident, tpl, null, decldefs); | 1252 auto tempdecl = new TemplateDeclaration(fd.loc, fd.ident, tpl, null, decldefs); |
1253 tempdecl.literal = 1; // it's a template 'literal' | 1253 tempdecl.literal = 1; // it's a template 'literal' |
1254 tiargs.push(cast(void*)tempdecl); | 1254 tiargs.push(tempdecl); |
1255 goto L1; | 1255 goto L1; |
1256 } | 1256 } |
1257 } | 1257 } |
1258 } | 1258 } |
1259 | 1259 |
1260 tiargs.push(cast(void*)ea); | 1260 tiargs.push(ea); |
1261 } | 1261 } |
1262 L1: | 1262 L1: |
1263 if (token.value != TOKcomma) | 1263 if (token.value != TOKcomma) |
1264 break; | 1264 break; |
1265 nextToken(); | 1265 nextToken(); |
1308 case TOKbool: ta = Type.tbool; goto LabelX; | 1308 case TOKbool: ta = Type.tbool; goto LabelX; |
1309 case TOKchar: ta = Type.tchar; goto LabelX; | 1309 case TOKchar: ta = Type.tchar; goto LabelX; |
1310 case TOKwchar: ta = Type.twchar; goto LabelX; | 1310 case TOKwchar: ta = Type.twchar; goto LabelX; |
1311 case TOKdchar: ta = Type.tdchar; goto LabelX; | 1311 case TOKdchar: ta = Type.tdchar; goto LabelX; |
1312 LabelX: | 1312 LabelX: |
1313 tiargs.push(cast(void*)ta); | 1313 tiargs.push(ta); |
1314 nextToken(); | 1314 nextToken(); |
1315 break; | 1315 break; |
1316 | 1316 |
1317 case TOKint32v: | 1317 case TOKint32v: |
1318 case TOKuns32v: | 1318 case TOKuns32v: |
1334 case TOKfile: | 1334 case TOKfile: |
1335 case TOKline: | 1335 case TOKline: |
1336 { | 1336 { |
1337 // Template argument is an expression | 1337 // Template argument is an expression |
1338 Expression ea = parsePrimaryExp(); | 1338 Expression ea = parsePrimaryExp(); |
1339 tiargs.push(cast(void*)ea); | 1339 tiargs.push(ea); |
1340 break; | 1340 break; |
1341 } | 1341 } |
1342 | 1342 |
1343 default: | 1343 default: |
1344 error("template argument expected following !"); | 1344 error("template argument expected following !"); |