-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcpp.json
139 lines (115 loc) · 3.92 KB
/
cpp.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": "C++",
"ext": "cpp",
"h_ext": "hpp",
"line_end": ";",
"ident": "{{name}}",
"true": "true",
"false": "false",
"then": [],
"run": [
"g++ {{file}}.cpp -std=c++17 -o repp_{{file}}",
"repp_{{file}}",
"del repp_{{file}}"
],
"bracket": {
"block_open": "{",
"block_close": "}",
"value_open": "(",
"value_close": ")",
"dotarray_open": "std::vector<int>({",
"dotarray_close": "})",
"list_open": "{",
"list_close": "}"
},
"operator": {
"commas" : ",",
"pointer" : "(&({{exp}}))",
"de_pointer" : "(*({{exp}}))",
"await" : "(({{exp}}).get())",
"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" : "std::pair<std::string, std::string>({{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 (int {{var}} = 0; {{var}}<{{time}}; {{var}}++) { {{block}} }",
"foreach": "for ({{var}} : {{collection}}) { {{block}} }"
},
"calls": {
"call": "{{method}}({{args}})",
"call_wrapped": "{{method}}{{args}}",
"method_call" : "{{object}}.{{call}}"
},
"types": {
"deduce_type": "auto",
"constant": "const",
"void_type": "void",
"integer": "int"
},
"lambda_blocks": "[&]({{args}}){ {{block}} }",
"to_lambdas": "[&](auto...pp){return ({{function}}({{args}}pp...));}",
"lambdas": "[&]({{args}}){ return( {{exp}} ); }",
"returns": "return ({{exp}});",
"namespaces": "namespace {{name}} { {{block}} }",
"iter_vars": "{{type}} {{name}}",
"arg_vars": "{{type}} {{name}}",
"header_guards": "#ifndef __{{token}}_H__\n#define __{{token}}_H__\n{{contents}}\n#endif",
"funcs": {
"functions": "{{type}} {{name}}({{args}}) { {{block}} }",
"constructor": "{{class}}({{args}}){ {{block}} }",
"entry": "int main(){ {{block}} }"
},
"assigns": {
"reference": {
"const": "const {{type}}& {{name}} = {{ref}}",
"make": "{{type}}& {{name}} = {{ref}}",
"let": "{{type}}& {{name}} = {{ref}}",
"instance": "{{type}}& {{name}} = {{ref}}"
},
"copy": {
"const": "const {{type}} {{name}} = {{copy}}",
"make": "{{type}}* {{name}} = new {{type}}({{copy}})",
"let": "{{type}} {{name}} = {{copy}}",
"instance": "{{type}} {{name}} = {{copy}}"
},
"construct": {
"const": "const {{type}} {{name}}({{args}})",
"make": "{{type}}* {{name}} = new {{type}}({{args}})",
"let": "{{type}} {{name}}({{args}})",
"instance": "{{type}} {{name}}({{args}})"
}
},
"imports": {
"import": "#include \"{{path}}.hpp\"\n",
"stdlib": "#include \"worldlib.hpp\"\n",
"library": "#include <{{path}}>\n",
"targetstdlibpath": "worldlib.hpp",
"stdlibpath": "libs/worldlib.hpp"
},
"classes": {
"inherit": "class {{name}} : {{super}} { {{block}} };",
"class": "class {{name}}{ {{block}} };"
},
"access": {
"protected": "protected:",
"private": "private:",
"public": "public:"
}
}