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.

let.ts 749B

123456789101112131415161718192021222324
  1. import * as AST from '../ast';
  2. import Env, { EnvError } from '../env';
  3. export class Let {
  4. public bindings: AST.Binding[];
  5. public children: AST.Node[];
  6. public constructor(bindings: AST.Binding[], children: AST.Node[]) {
  7. this.bindings = bindings;
  8. this.children = children;
  9. }
  10. public compile(env: Env, opts: AST.Opts): string | EnvError {
  11. this.bindings.forEach((binding) => {
  12. env.set(binding.identifier.name.value, binding.value);
  13. });
  14. const children = this.children.map((child) => child.compile(env, opts));
  15. const childrenError = children.find((node) => node instanceof EnvError);
  16. if (childrenError instanceof EnvError) return childrenError;
  17. return children.join(opts.prettyPrint ? '\n' : '');
  18. }
  19. }