wrote trannspiler
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user