(ctx: PrintContext)
| 854 | } |
| 855 | |
| 856 | override print(ctx: PrintContext) { |
| 857 | this.type.markUsed(ctx); |
| 858 | const {isFullDeclaraion, isMethodDeclaration, isClassDeclaration} = this.getPrintMode(ctx); |
| 859 | let result = ctx.prefix; |
| 860 | if (this.modifiers.includes('static')) { |
| 861 | if (isClassDeclaration) |
| 862 | result += 'static '; |
| 863 | else if (isMethodDeclaration) |
| 864 | result = `${ctx.prefix}// static\n${result}`; |
| 865 | } |
| 866 | if (isClassDeclaration && this.modifiers.includes('virtual')) |
| 867 | result += 'virtual '; |
| 868 | result += `${this.type.returnType.print(ctx)} `; |
| 869 | result += isMethodDeclaration ? `${this.classDeclaration!.name}::${this.name}` : this.name; |
| 870 | result += '('; |
| 871 | result += ParameterDeclaration.printParameters(ctx, this.parameters); |
| 872 | result += ')'; |
| 873 | if (this.modifiers.includes('const')) |
| 874 | result += ' const'; |
| 875 | if (isClassDeclaration && this.modifiers.includes('override')) |
| 876 | result += ' override'; |
| 877 | if (isMethodDeclaration || isFullDeclaraion) |
| 878 | result += ' ' + (this.body?.print(ctx) ?? '{}'); |
| 879 | else |
| 880 | result += ';'; |
| 881 | return result; |
| 882 | } |
| 883 | } |
| 884 | |
| 885 | export abstract class Statement { |
nothing calls this directly
no test coverage detected