-
Notifications
You must be signed in to change notification settings - Fork 1
/
nodejs.json
145 lines (119 loc) · 4 KB
/
nodejs.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
140
141
142
143
144
145
{
"name": "Node.Js",
"ext": "js",
"h_ext": "js",
"line_end": ";",
"ident": "{{name}}",
"true": "true",
"false": "false",
"then": [],
"run": [
"node {{file}}.js"
],
"bracket": {
"block_open": "{",
"block_close": "}",
"value_open": "(",
"value_close": ")",
"dotarray_open": "[",
"dotarray_close": "]",
"list_open": "[",
"list_close": "]"
},
"operator": {
"commas" : ",",
"pointer" : "[{{exp}}]",
"de_pointer" : "{{exp}}[0]",
"await" : "(await {{exp}})",
"async" : "(async {{exp}})",
"tenary": "(({{condition}})?({{l}}):({{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}}) { {{block}} }",
"else_if": "else if ({{exp}}) { {{block}} }",
"else": "else { {{block}} }",
"while": "while ({{exp}}) { {{block}} }",
"repeat": "for (let {{var}} = 0; {{var}}<{{time}}; {{var}}++) { {{block}} }",
"foreach": "for ({{var}} of {{collection}}) { {{block}} }"
},
"calls": {
"call": "{{method}}({{args}})",
"call_wrapped": "{{method}}{{args}}",
"method_call" : "{{object}}.{{call}}"
},
"types": {
"deduce_type": "let",
"constant": "",
"void_type": "",
"integer": "",
"_constant": "const",
"_void_type": "void",
"_integer": "Number"
},
"lambda_blocks": "({{args}})=>{{ {block} }}",
"to_lambdas": "(...pp)=>({{function}}({{args}}pp...))",
"lambdas": "({{args}}) => ( {{exp}} )",
"returns": "return ({{exp}});",
"_namespaces": "namespace {{name}} { {{block}} }",
"iter_vars": "let {{name}}",
"arg_vars": "{{name}}",
"header_guards": "{{contents}}",
"funcs": {
"functions": "function {{name}}({{args}}) { {{block}} }",
"constructor": "constructor({{args}}){ {{block}} }",
"entry": "(async ()=>{ {{block}} })();"
},
"assigns": {
"reference": {
"const": "const {{name}} = {{ref}}",
"make": "let {{name}} = {{ref}}",
"let": "let {{name}} = {{ref}}",
"instance": ""
},
"copy": {
"const": "const {{name}} = {{copy}}",
"make": "let {{name}} = new {{type}}({{copy}})",
"let": "let {{name}} = {{copy}}",
"instance": ""
},
"construct": {
"const": "const {{type}} {{name}}({{args}})",
"make": "let {{name}} = new {{type}}({{args}})",
"let": "let {{name}} = new {{type}}({{args}})",
"instance": ""
}
},
"imports": {
"import": "const {{path}} = require('{{path}}');\n",
"stdlib": "const{print,println,input,input_line,static_input,static_input_line,tup,vec,until,sum,max,map,cat,each,fold,bfold,integrate,filter,wait,get_time,make_string,stoi,string,vector,i1,i2,i4,i8,u1,u2,u4,u8,f4,f8,ci1,ci2,ci4,ci8,cu1,cu2,cu4,cu8,cf4,cf8}=require('./worldlib');\n",
"library": "const {{path}} = require('{{path}}');\n",
"targetstdlibpath": "worldlib.js",
"stdlibpath": "libs/worldlib.js"
},
"classes": {
"inherit": "class {{name}} extends {{super}} { {{block}} }",
"class": "class {{name}}{ {{block}} }"
},
"access": {
"protected": "",
"private": "",
"public": "",
"_protected": "protected",
"_private": "private",
"_public": "public"
}
}