-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpython.json
139 lines (115 loc) · 3.56 KB
/
python.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{
"name": "Python",
"ext": "by",
"h_ext": "by",
"line_end": ";\n",
"ident": "{{name}}",
"true": "True",
"false": "False",
"then": [
"py scripts/wl.py {{file}}.by"
],
"run": [
"py {{file}}.py"
],
"bracket": {
"block_open": "\n{\n",
"block_close": "\n}\n",
"value_open": "(",
"value_close": ")",
"dotarray_open": "[",
"dotarray_close": "]",
"list_open": "[",
"list_close": "]"
},
"operator": {
"commas" : ",",
"pointer" : "[{{exp}}]",
"de_pointer" : "({{exp}})[0]",
"await" : "{{exp}}",
"async" : "{{exp}}",
"tenary": "({{l}}) if (({{condition}}) else ({{r}}))",
"assign" : "{{l}} = {{r}}",
"plus" : "({{l}} + {{r}})",
"minus" : "({{l}} - {{r}})",
"bitor" : "({{l}} | {{r}})",
"or" : "({{l}} || {{r}})",
"bitand" : "({{l}} & {{r}})",
"and" : "({{l}} && {{r}})",
"eq" : "({{l}} == {{r}})",
"neq" : "({{l}} != {{r}})",
"pair" : "({{l}}, {{r}})",
"property" : "{{object}}.{{name}}",
"context" : "{{context}}.{{member}}",
"index" : "{{exp}}[{{at}}]",
"else" : "({{l}} {{operator}} {{r}})"
},
"blocks": {
"if": "if ({{exp}}) {\n{{block}}\n}\n",
"else_if": "elif ({{exp}}) {\n{{block}}\n}\n",
"else": "else {\n{{block}}\n}\n",
"while": "while ({{exp}}) {\n{{block}}\n}\n",
"repeat": "for {{var}} in range({{time}}) {\n{{block}}\n}\n",
"foreach": "for {{var}} in {{collection}} {\n{{block}}\n}\n"
},
"calls": {
"call": "{{method}}({{args}})",
"call_wrapped": "{{method}}{{args}}",
"method_call" : "{{object}}.{{call}}"
},
"types": {
"deduce_type": "",
"constant": "",
"void_type": "",
"integer": "int"
},
"lambda_blocks": "",
"to_lambdas": "lambda *pp: {{function}}({{args}} *pp)",
"lambdas": "lambda ({{args}}): ({{exp}} )",
"returns": "return ({{exp}});",
"namespaces": "{{block}}",
"iter_vars": "{{name}}",
"arg_vars": "{{name}}",
"header_guards": "{{contents}}",
"funcs": {
"functions": "def {{name}}({{args}}) {\n{{block}}\n}\n",
"constructor": "def __init__({{args}}){\n{{block}}\n}\n",
"entry": "if __name__=='__main__' {\n{{block}}\n}\n"
},
"assigns": {
"reference": {
"const": "{{name}} = {{ref}}",
"make": "{{name}} = {{ref}}",
"let": "{{name}} = {{ref}}",
"instance": "{{name}} = {{ref}}"
},
"copy": {
"const": "{{name}} = {{copy}}",
"make": "{{name}} = {{type}}({{copy}})",
"let": "{{name}} = {{copy}}",
"instance": "{{name}} = {{copy}}"
},
"construct": {
"const": "{{name}} = {{type}}({{args}})",
"make": "{{name}} = {{type}}({{args}})",
"let": "{{name}} = {{type}}({{args}})",
"instance": "{{name}} = {{type}}({{args}})"
}
},
"imports": {
"import": "from {{path}} import *\n",
"stdlib": "from worldlib import *\n",
"library": "import {{path}}\n",
"targetstdlibpath": "worldlib.py",
"stdlibpath": "libs/worldlib.py"
},
"classes": {
"inherit": "class {{name}}({{super}}) {\n{{block}}\n}\n",
"class": "class {{name}}{\n{{block}}\n}\n"
},
"access": {
"protected": "",
"private": "",
"public": ""
}
}