Skip to content

fix(dncl): keep the order of functions after running the Japanese program #2620

Done

Description

@smalruby3-editor-bot

autopilot-base: topic/japanese-mode-1731

不具合(B30)

日本語タブで長めのプログラム(リストへの追加・繰り返し・もし・関数 2 つ・定義より前の呼び出し)を一度実行してからコードタブ → 日本語タブへ戻ると、関数の定義がプログラムの先頭へ移る。実行しなければ 5 往復しても書いた順のまま。

docs(docs/dncl/README.md の「ブロックを通ったときの並び」)は「コードタブを通っても書いた順に戻る」としているので、食い違う。動きの意味は同じだが、生徒が書いた並びが変わる(B05 と同じ種類)。

再現

表示する(二倍(3))
関数 二倍(n):
    n * 2 を返す
A = []
i を 1 から 3 まで 1 ずつ増やしながら繰り返す:
    A に i * 10 を追加する
合計 = 0
i = 0
i < 3 の間繰り返す:
    合計 = 合計 + A[i]
    i = i + 1
もし 合計 > 50 and not (合計 == 100) ならば:
    表示する("大きい", 合計)
そうでなくもし 合計 > 10 ならば:
    表示する("ふつう")
そうでなければ:
    表示する("小さい")
関数 あいさつ(名前):
    表示する("やあ " + 名前)
あいさつ("たろう")

実行ボタン → コードタブ → 日本語タブ。関数 二倍 と 関数 あいさつ が先頭に並ぶ。短いプログラム(関数 1〜2 つ・リスト無し)では、実行しても起きなかった。最終レビュー R10 を AI が確かめたときに見つけた。

Activity

  1. moved this to Sprint Backlog in Autopiloton Nov 28, 2026
  2. moved this from Sprint Backlog to In Progress in Autopiloton Nov 28, 2026
  3. added
    🤖 autopilot
    on Nov 29, 2026
  4. smalruby3-editor-bot commented on Nov 29, 2026

    @smalruby3-editor-bot
    Author

    🤖 対応 PR: #2630 (base: topic/japanese-mode-1731)

    この PR は非デフォルト base 宛てのため GitHub の Development 欄に表示されません。このコメントは autopilot が管理します(編集しないでください)。

  5. moved this from In Progress to Review in Autopiloton Nov 29, 2026
  6. added a commit that references this issue on Nov 29, 2026
  7. moved this from Review to Close in Autopiloton Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🤖 autopilot

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions