Skip to content

Commit fe3e460

Browse files
authored
New Syntax Added
1 parent fd5124c commit fe3e460

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ Customize python syntax with [LangTrans](https://github.com/LangTrans/LangTrans)
33
## Customized Syntax
44
```js
55
p"Hello World"
6-
add = (x) => x+1
7-
print|add|add(1)
8-
try add("1") Exception print("Error:",err)
6+
inc = (x) => x+1
7+
add(x,y)=>x+y
8+
print(![inc => 1..6])
9+
print|inc|inc(1)
10+
try inc("1") Exception print("Error:",err)
911
test ="test"
1012
=test.replace("test","")
1113
x = True
@@ -15,13 +17,14 @@ print("Done") if x
1517
## Orginal Syntax
1618
```python
1719
print("Hello World")
18-
add = lambda x: x+1
19-
print(add(add(1)))
20+
inc = lambda x: x+1
21+
add = lambda x,y:x+y
22+
print(list(map(inc,range(1,6+1))))
23+
print(inc(inc(1)))
2024
try:
21-
add("1")
25+
inc("1")
2226
except Exception as err:
2327
print("Error:",err)
24-
2528
test ="test"
2629
test=test.replace("test","")
2730
x = True

0 commit comments

Comments
 (0)