assemblyscript icon indicating copy to clipboard operation
assemblyscript copied to clipboard

[Std][Feature] Implement String.dedent

Open MaxGraey opened this issue 3 years ago • 0 comments

Currently, it is on Stage 2, slides. But it's quite important, especially for AssemblyScript which doesn't provide custom templates on user space yet.

Implementation Plan

Similar to String.raw it should be completely implemented as compiler's builtin.

  • Add builtin stub

    @builtin static dedent(parts: TemplateStringsArray, ...substitutions: unknown[]): string { 
      return unreachable(); 
    }
    

    to std/string.ts

  • Add implementation for function builtin_string_dedent(ctx: BuiltinContext): ExpressionRef in src/builtin.ts following by proposal-string-dedent spec

MaxGraey avatar Aug 06 '22 18:08 MaxGraey