import { LineResults } from "../LineResults" ; import { CommandNames } from "../Names/CommandNames" ; import { Command } from "./Command" ; import { CommandResult } from "./CommandResult" ; import { CommandMetadata } from "./Metadata/CommandMetadata" ; /**
 * Ends a main function.
 */ export class MainEndCommand extends Command { /**
     * Metadata on the command.
     */ private static metadata : CommandMetadata = new CommandMetadata ( CommandNames . MainEnd ) . withDescription ( "Ends a main function" ) . withIndentation ( [ - 1 ] ) ; returns public getMetadata ( ) { return MainEndCommand . metadata ; } param parameters returns public render ( parameters ) { const output = [ ] ; const endLines = this . language . syntax . main . mainEndLines ; for ( const endLine of endLines ) { output . push ( new CommandResult ( endLine , 0 ) ) ; } if ( output . length !== 0 ) { output [ 0 ] . indentation = - this . language . syntax . main . mainIndentation ; } return new LineResults ( output ) ; } }