Skip to content

Commit f72fb19

Browse files
committed
v1.0BETA
1 parent c59a952 commit f72fb19

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1-
# MScript
1+
# MScript
2+
v1.0BETA
3+
## Documentation
4+
MScript is extremely similiar to Python in syntax and features; however, there are some differences:
5+
- `def` -> `func`
6+
- `and` -> `&`
7+
- `or` -> `|`
8+
- `match` -> `switch`
9+
<br />
10+
There is two versions of print: `println` and `print`. <br />
11+
`println` Automatically prints a value on a newline <br />
12+
`print` Prints very value on the same line

mscript.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import numpy as np
2+
3+
def read(file: str):
4+
with open(file, "r") as f:
5+
data = f.read()
6+
7+
return data
8+
9+
def mscrToPy(fileName: str):
10+
file = read(fileName)
11+
12+
mprint = file.replace("println(", "print(")
13+
mprint2 = mprint.replace('")', '\\n")')
14+
15+
python = mprint2.replace("func", "def").replace("&", "and").replace("|", "or").replace("switch", "match")
16+
17+
with open(f"{file}.py", "w") as i:
18+
i.write(str(python))
19+
20+
return file

0 commit comments

Comments
 (0)