Skip to content

Conversation

@takejohn
Copy link
Member

@takejohn takejohn commented Dec 15, 2025

What

文字列リテラルやテンプレートリテラル中のエスケープシーケンス\t, \n, \rがそれぞれ水平タブ、改行、復帰として解釈されるようにします。
また、\uから始まるUnicodeエスケープシーケンスに対応します。
\", \', \`, \{, \}については従来と同様、\の直後の文字そのものとなりますが、
\の後に上記の文字以外が続くと文法エラーが発生するようになります。

ECMAScriptの仕様と異なり、\b, \v, \fには対応せず、文字によっては\の後に続けると言語として受理しません。

Why

#392

Additional info (optional)

破壊的変更なので、aiscript-nextを宛先ブランチにしてあります。

@codecov-commenter
Copy link

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/parser/scanner.ts 88.88% 2 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Files with missing lines Coverage Δ
src/utils/characters.ts 100.00% <100.00%> (ø)
src/parser/scanner.ts 95.48% <88.88%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FineArchs
Copy link
Member

Aison.escapeString()を実装する時に楽な形にできないかなぁとか余計なことを考えているのでちょっとお待ちください

@FineArchs
Copy link
Member

特に思いつかなかったのでapproveします。

- `\n` - 改行 (U+000A)
- `\r` - 復帰 (U+000D)
- `\u`とそれに続く4桁の16進数の英数字 - 与えられた値を持つUTF-16コード単位として解釈されます。
- `\"`, `\'`, `` \` ``, `\{`, `\}` - それぞれ、`\`の直後の文字そのものとなります。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

\\\ になることも書いてあったほうがいいと思います

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants