Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Feb 19, 2018. It is now read-only.
/discussPublic archive
This repository was archived by the owner on Feb 19, 2018. It is now read-only.

CS2 Discussion: Output: ES6 template literals for CoffeeScript interpolated strings #41

Closed
@greghuc

Description

@greghuc

As discussedhere, I'm splitting out a separate issue for compiling Coffeescript interpolated strings to ES6template literals.

In short, Coffeescript single-line, multi-line and block interpolated strings can all be compiled to ES6 template literals. To note:

  • This change feels like 'Coffeescript 2.0', as it uses an ES6 feature for an existing Coffeescript feature. So if you use Coffeescript strings, you won't be able to opt out of ES6.
  • This feature should be implemented aftertagged template literals. Implementation of that feature will do most of the heavy lifting on determining how template literals play with Coffeescript.

Examples:

Single-line string:

//CS input"Hi #{name} Do you like #{food}?"//ES6 output`Hi ${name} Do you like ${food}?`;

Multiline string:

//CS input"Hi #{name}. Do you like #{food}?"//ES6 outputupperExpr`Hi ${name}. Do you like ${food}?`;

Block string:

//CS input"""         <strong>           cup of #{language}         </strong>"""//ES6 outputupperExpr`<strong>\n  cup of ${language}\n</strong>`;

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp