Repository navigation
fix(ja-notation): read a reading comma in block lines like の間,繰り返す: - #2275
Merged
smalruby3-editor-bot[bot] merged 1 commit intoNov 19, 2026
Merged
smalruby3-editor-bot[bot] merged 1 commit into
smalruby3-editor-bot[bot] merged 1 commit into
Conversation
The Japanese reader takes a `,` / `、` / `,` (with spaces) right after `の間`, `ならば` / `なら`, `そうでなければ` and `増やしながら` / `減らしながら` when it is followed by `繰り返す`, the `:` or the end of the line. Writing stays without the comma. Closes #2274 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🚀 Preview deployed (stg API): https://preview.smalruby.app/fix-ja-notation-comma-2274-9dd23548/ |
smalruby3-editor-bot
Bot
merged commit Nov 19, 2026
9702518
into
topic/japanese-mode-1731
11 checks passed
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
日本語タブで
x < 3 の間,繰り返す:のように読点を入れると「「の間」が読めません」になっていたのを直す。docs/dncl/policy.mdの「見た目だけの揺れは、読むときは全部受け付け、書くときは 1 つにそろえる」に従う。直し方
packages/ja-notation/src/parse.jsにwithoutReadingCommasを足し、行を読む前に、ブロックの行の決まった句の直後の読点を取り除く。,(,として読まれる)・、(いままで「読めない字」だった)・,。前後の空白・全角空白も可の間/ならば/なら/そうでなければ/…増やしながら/…減らしながらで、直後が繰り返す・:・行の終わりのときだけ。値の中の,(f(a, b)・a = 0, b = 1)は今までどおりもし m > 0 ならば,s = 1(1 行の if はもともと書けない)、n < 5,の間繰り返す:書き出し(Ruby → 日本語)は変えない(読点を入れない形)。
受け付けるようになった揺れ
n < 5 の間,繰り返す:/の間 、 繰り返す:/の間, 繰り返す:n < 5 の間繰り返す:n < 5 の間,:n < 5 の間繰り返す:n < 5 の間,…を繰り返す(DNCL 風)k を … 2 ずつ増やしながら,繰り返す:/ずつ 減らしながら、繰り返す:k を … ずつ増やしながら,…を繰り返す(DNCL 風)もし … ならば,:/そうでなくもし … ならば、:/そうでなければ,:もし … ならば,/なら,/そうでなければ,…を実行する(DNCL 風)テスト
packages/ja-notation/test/data/parse.json:sameに 10 行(上の表)、errorsに 2 行(読めないままのもの)packages/ja-notation/test/data/ja-to-ruby.json: 読点を入れた while / if / else / 数える繰り返しの入れ子 1 件packages/scratch-gui/test/unit/lib/dncl/dncl-validator.test.js: GUI のdnclToRubyを通して誤りが出ないこと、閉じ忘れの文言が今までどおりのことUPDATE_JA_GOLDEN=1で作り直したが 差は 0(コーパスに読点のある形が無いため。意図どおり)node --test(ja-notation、242 件)、上の jest 2 ファイル、ja-notation と scratch-gui の lintdocs
docs/dncl/README.mdの「読む書き方」の表に 1 行足した。Closes #2274
🤖 Generated with Claude Code