Skip to content

[BUG] Devanagari numerals inside string literals are converted to ASCII #23

Description

@alphacrack

File: maithili_dsl/transpiler/transpile.py:87

convert_devanagari_numerals() runs on the whole source before the tokenizer separates string literals, so numerals inside strings get rewritten and program output changes:

Input:  छपाउ("५ टा")
Output: print("5 टा")   # prints "5 टा" instead of "५ टा"

(Verified against v0.3.0.)

Fix: move the numeral conversion inside the token loop in transpile_maithili_code() so it only applies to code regions (the is_string == False branch), exactly like keyword replacement already does.

Tests: add cases to tests/test_transpile.py — numeral in a string stays Devanagari, numeral in code still converts, mixed lines work.

Good first issue: the fix is moving one function call and adding ~3 tests. Comment here to claim it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority: plan for next cyclearea:transpilermaithili_dsl/transpiler/transpile.pybugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions