Skip to content

fix(dncl): 添字への多重代入(a[0], a[1] = a[1], a[0])から壊れた Ruby ができる #2237

Closed

Description

@smalruby3-editor-bot

なにが起きているか

日本語モードで、添字のついた要素への多重代入(入れかえ)を書くと、壊れた Ruby ができる。

a[0], a[1] = a[1], a[0]

→ ja-notation が []=, []= = @a[1], @a[0] のような Ruby を作り、prism の英語の構文エラーが 7 件出る。

(topic/japanese-mode-1731、J0〜J6 のあとで確認。#1822 の整理のときに見つけた)

直す場所

packages/ja-notation/src/write-ruby.js(多重代入の左辺が添字のとき)。往復(Ruby の @a[0], @a[1] = @a[1], @a[0] → 日本語 → Ruby)も確かめる。書けない形にするなら、行のわかる日本語の誤りにする。

関係

Activity

  1. smalruby3-editor-bot commented on Nov 18, 2026

    @smalruby3-editor-bot
    Author

    topic/japanese-mode-1731 にマージしました(PR #2240 / #2242 / #2244)。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions