@@ -138,6 +138,38 @@ module.exports =
138
138
139
139
' C++' :
140
140
if GrammarUtils .OperatingSystem .isDarwin ()
141
+ " Selection Based" :
142
+ command : " bash"
143
+ args : (context ) ->
144
+ code = context .getCode (true )
145
+ tmpFile = GrammarUtils .createTempFileWithCode (code, " .cpp" )
146
+ [" -c" , " xcrun clang++ -fcolor-diagnostics -std=c++14 -Wall -include stdio.h -include iostream '" + tmpFile + " ' -o /tmp/cpp.out && /tmp/cpp.out" ]
147
+ " File Based" :
148
+ command : " bash"
149
+ args : (context ) -> [' -c' , " xcrun clang++ -fcolor-diagnostics -std=c++14 -Wall -include stdio.h -include iostream '" + context .filepath + " ' -o /tmp/cpp.out && /tmp/cpp.out" ]
150
+ else if GrammarUtils .OperatingSystem .isLinux ()
151
+ " Selection Based" :
152
+ command : " bash"
153
+ args : (context ) ->
154
+ code = context .getCode (true )
155
+ tmpFile = GrammarUtils .createTempFileWithCode (code, " .cpp" )
156
+ [" -c" , " g++ -std=c++14 -Wall -include stdio.h -include iostream '" + tmpFile + " ' -o /tmp/cpp.out && /tmp/cpp.out" ]
157
+ " File Based" :
158
+ command : " bash"
159
+ args : (context ) -> [" -c" , " g++ -std=c++14 -Wall -include stdio.h -include iostream '" + context .filepath + " ' -o /tmp/cpp.out && /tmp/cpp.out" ]
160
+ else if GrammarUtils .OperatingSystem .isWindows () and GrammarUtils .OperatingSystem .release ().split (" ." ).slice - 1 >= ' 14399'
161
+ " File Based" :
162
+ command : " bash"
163
+ args : (context ) -> [" -c" , " g++ -std=c++14 -Wall -include stdio.h -include iostream '/mnt/" + path .posix .join .apply (path .posix , [].concat ([context .filepath .split (path .win32 .sep )[0 ].toLowerCase ()], context .filepath .split (path .win32 .sep ).slice (1 ))).replace (" :" , " " ) + " ' -o /tmp/cpp.out && /tmp/cpp.out" ]
164
+
165
+ ' C++14' :
166
+ if GrammarUtils .OperatingSystem .isDarwin ()
167
+ " Selection Based" :
168
+ command : " bash"
169
+ args : (context ) ->
170
+ code = context .getCode (true )
171
+ tmpFile = GrammarUtils .createTempFileWithCode (code, " .cpp" )
172
+ [" -c" , " xcrun clang++ -fcolor-diagnostics -std=c++14 -Wall -include stdio.h -include iostream '" + tmpFile + " ' -o /tmp/cpp.out && /tmp/cpp.out" ]
141
173
" File Based" :
142
174
command : " bash"
143
175
args : (context ) -> [' -c' , " xcrun clang++ -fcolor-diagnostics -std=c++14 -Wall -include stdio.h -include iostream '" + context .filepath + " ' -o /tmp/cpp.out && /tmp/cpp.out" ]
0 commit comments