Repository navigation
fix(ja-notation): read full-width letters and digits as half-width ones - #2267
Merged
smalruby3-editor-bot[bot] merged 4 commits intoNov 19, 2026
Merged
smalruby3-editor-bot[bot] merged 4 commits into
smalruby3-editor-bot[bot] merged 4 commits into
Conversation
…them The Japanese mode is written for a program that runs alone, as on a terminal, and has no stage. Ruby → Japanese tells each `$a` (a variable or a list of the stage) at its name as `stage-variable`, which the editor says as "ステージの変数($a)は日本語モードでは書けません。Ruby モードでは書けます。", in place of the no-ja-form error of the whole statement. Closes #1706 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Out of the strings and the comments, the lexer makes the full-width letters and digits half-width before it reads them (`x1` is `x1`, `and` is `and`), as the auto-correct of the Ruby mode does. A full-width letter is no longer a name of its own (the decision of #1714 is taken back). The strings and the comments keep what is written. Closes #2266 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🚀 Preview deployed (stg API): https://preview.smalruby.app/fix-ja-notation-fullwidth-alnum-8536cbf7/ |
smalruby3-editor-bot
Bot
merged commit Nov 19, 2026
9adffd3
into
topic/japanese-mode-1731
11 checks passed
This was referenced Nov 19, 2026
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.
Summary
日本語モード EPIC #1731 の確認ページの答え W8。全角英字・全角数字を、文字列とコメントの外では読む前にすべて半角にする(Ruby モードの自動置換と同じ考え)。#1714 の「全角英字は別の名前」は取り消し。
x1 = 12x1 = 12(x1は別の名前)x1 = 12a > 0 and bandは名前a > 0 && b表示する("ABC")x = 1 # x は全角Changes Made
lexer.js:tokenizeが、次の文字列・コメントの始まりまでのコードをhalfWidthAlphanumericsで半角にしてから読む(1 字ずつ同じ長さなので列は変わらない。//がコメントの記号のときも、そのコメントは変えない)。数の全角数字の扱い(fix(dncl): '2倍' and full-width digits like '12' make broken Ruby #1752)はこれに含まれ、名前の中の全角数字も半角になる。docs/dncl/README.md(名前に使える文字・lexer・表)、docs/dncl/policy.md(見た目だけの揺れの例)、docs/smalruby-dncl-spec.ja.md。Test Coverage
packages/ja-notation/test/data/ja-to-ruby.json: 既存 3 行の期待を書きかえ(x1→x1、x1→x1、10回の誤りの文が「10回」)、4 行を追加(文字列・コメント・and・//のコメント)。test/unit/lib/dncl/dncl-number-notation.test.js: 名前の中の全角が半角になること、文字列とコメントは変えないこと。UPDATE_JA_GOLDEN=1):golden/ja.jsonの 1 件(ja-906fd1a488)で@x1→@x1(意図どおり)。Closes #2266
🤖 Generated with Claude Code