Skip to content

Commit d6c7b81

Browse files
committed
Final commit before release v1.1.0
- Added some type annotation where missing in lang.py - Updated README.md with languages section, and "Keyword Replacement Example Title" - Moved CONTRIBUTING.md from project root to .github/ - Moved codeowners to .github/, added contributors for the misc language example modules, updated some entries according to new structure
1 parent cb3a441 commit d6c7b81

4 files changed

Lines changed: 23 additions & 8 deletions

File tree

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Russian/Gen Alpha Examples, Documentation
22
examples/ru/* @CalciumKing
33
examples/gen_alpha/* @CalciumKing
4-
lang.csv @CalciumKing
4+
template_dict.csv @CalciumKing
55
README.md @CalciumKing
6-
CONTRIBUTING.md @CalciumKing
76
.github/* @CalciumKing
7+
images/* @CalciumKing
88
LICENSE @CalciumKing
99

1010
# Thai Examples, Debugger File
@@ -13,3 +13,8 @@ debug/* @petepoop
1313

1414
# Compiler is co-owned
1515
lang.py @CalciumKing @petepoop
16+
17+
# Misc. Language Examples
18+
examples/ar/* @fredtheonlychild
19+
examples/hi/* @CodingSkywalker
20+
examples/kr/* @Petmaster123
File renamed without changes.

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ code.
88

99
This project also has the potential to translate any language supported by UTF-8 into valid python code.
1010

11+
## Language Examples Provided
12+
- Russian
13+
- Thai
14+
- Korean
15+
- Standard Arabic
16+
- Hindi
17+
- Gen Alpha (English)
18+
1119
## Installation
1220

1321
You don't need to "install" anything special. Just make sure you have Python 3 (preferably 3.10 or later, for
@@ -35,7 +43,9 @@ You don't need to "install" anything special. Just make sure you have Python 3 (
3543

3644
## Examples
3745

38-
1. `lang.csv` (Example):
46+
### Keyword Replacement Process
47+
48+
1. `dict.csv`:
3949
```csv
4050
def,myfunc
4151
return,sendback
@@ -45,7 +55,7 @@ You don't need to "install" anything special. Just make sure you have Python 3 (
4555
```
4656

4757
2. Custom Code (hello.tpy):
48-
```text
58+
```py
4959
myfunc greet(name) {
5060
say("Hello " + name)
5161
sendback "done"

lang.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ def replacer(match) -> str:
8787
translations: dict[str, str] = get_translations()
8888

8989
for py_word in translations.keys():
90-
pattern = re.escape(translations[py_word])
91-
program = re.sub(pattern, replacer, program)
90+
pattern: str = re.escape(translations[py_word])
91+
program: str = re.sub(pattern, replacer, program)
9292

9393
return program
9494

@@ -114,15 +114,15 @@ def main() -> None:
114114
raise IOError('Must Provide Additional Arguments')
115115

116116
# Read code from file
117-
filename = sys.argv[1]
117+
filename: str = sys.argv[1]
118118

119119
if not filename.endswith('.tpy'):
120120
raise FileNotFoundError('Your Chosen File Is Not A .tpy File')
121121

122122
with open(filename, 'r', encoding='utf-8') as f:
123123
code = f.read()
124124

125-
python_program = translate_program(code)
125+
python_program: str = translate_program(code)
126126

127127
if len(sys.argv) == 3:
128128
run_program(python_program)

0 commit comments

Comments
 (0)