Skip to content

[Std][Feature] Implement String.dedent #2413

Open
@MaxGraey

Description

@MaxGraey

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions