| 407 | } |
| 408 | |
| 409 | parseVariableDeclarationList(node: ts.VariableDeclarationList): syntax.VariableDeclarationList { |
| 410 | const decls = node.declarations.map(this.parseVariableDeclaration.bind(this)); |
| 411 | // In C++ all variables in one declaration use the same type. |
| 412 | const {type} = decls[0]; |
| 413 | if (!decls.every(d => type.equal(d.type))) |
| 414 | throw new UnimplementedError(node, 'Variable declaration list must use same type'); |
| 415 | return new syntax.VariableDeclarationList(decls); |
| 416 | } |
| 417 | |
| 418 | parseVariableDeclaration(node: ts.VariableDeclaration): syntax.VariableDeclaration { |
| 419 | switch (node.name.kind) { |