Skip to content

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

Description

@alphacrack

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority: plan for next cyclearea:transpilermaithili_dsl/transpiler/transpile.pybugSomething isn't workinggood first issueGood for newcomerskeyword-mappingNew or changed Maithili keyword / module mappings

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions