diff --git a/src/tampy/transpiler.py b/src/tampy/transpiler.py index e69de29..2e17fcd 100644 --- a/src/tampy/transpiler.py +++ b/src/tampy/transpiler.py @@ -0,0 +1,14 @@ +import json +from pathlib import Path + +KEYWORDS_PATH = Path(__file__).parent / "keywords.json" + +with open(KEYWORDS_PATH, "r", encoding="utf-8") as f: + KEYWORDS = json.load(f) + +def transpile(code: str) -> str: + """Replace Tamil keywords with Python equivalents.""" + output = code + for tamil, python in KEYWORDS.items(): + output = output.replace(tamil, python) + return output