A stylesheet language written in TypeScript that compiles to CSS
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

application.ts 653B

123456789101112131415161718192021
  1. import * as AST from '../ast';
  2. import Env, { EnvError } from '../env';
  3. export class Application {
  4. public name: AST.Literal;
  5. public arguments: AST.Node[];
  6. public constructor(name: AST.Literal, args: AST.Node[]) {
  7. this.name = name;
  8. this.arguments = args;
  9. }
  10. public compile(env: Env, opts: AST.Opts): string | EnvError {
  11. const wordSpacer = opts.prettyPrint ? ' ' : '';
  12. const [lParen, rParen, comma] = ['(', ')', ','];
  13. const compiledArguments = this.arguments
  14. .map((arg) => arg.compile(env, opts))
  15. .join(`${comma}${wordSpacer}`);
  16. return `${this.name.value.value}${lParen}${compiledArguments}${rParen}`;
  17. }
  18. }