[BUG] No elif mapping — नहि त यदि transpiles to invalid else if

オープン 初心者向け
#25 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
78/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
python
領域
compilers

調査の方向性

キーワードの対応付けは maithili_dsl/transpiler/mappings.py の DEVNAGIRI_KEYWORD_MAP にあります。パターンは挿入順に適用されるため、既存の नहि त のエントリより前に、フレーズ नहि त यदि を elif に対応付けて追加してください。maithili_dsl/transpiler/linter.py の38〜40行目付近を確認し、変更なしでこのチェーンをすでに受け入れることを確かめてください。यदि / नहि त यदि / नहि त のチェーン全体をテストする中で नहि त यदि क > ५: が elif に変換され、リンターのテストが通れば完了です。

索引モデルが issue の本文から書いたものです。

説明

area:transpiler bug good first issue keyword-mapping P2

Files: maithili_dsl/transpiler/mappings.py, maithili_dsl/transpiler/linter.py:38

There is no elif mapping, and writing the natural construct produces invalid Python:

Input:  नहि त यदि क > ५:
Output: else if क > 5:    # SyntaxError at runtime

(Verified against v0.3.0 — नहि त → else and यदि → if are substituted independently.)

Fix:

  1. Add "नहि त यदि": "elif" to DEVNAGIRI_KEYWORD_MAP — ⚠️ it must be inserted before "नहि त" in the dict, because patterns are applied in insertion order and the longer phrase must win.
  2. The linter already tolerates नहि त ... यदि lines (linter.py:40), so no linter change should be needed — but add a linter test to prove it.

Tests: transpile test for a full यदि / नहि त यदि / नहि त chain; smoke-test an example using it.

Good first issue — the whole fix is one dict entry placed correctly, plus tests. Native speakers: if a different phrase than नहि त यदि is more natural for elif, please raise it here before implementing.

主要言語
Python
スター
1
フォーク
4
平均マージ
12日 21時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

alphacrack/python-maithili-dsl のほかの issue

alphacrack/python-maithili-dsl の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。