Skip to content

Commit 6773761

Browse files
authored
Merge pull request #1322 from ImJeevesh/dev_jeevesh
added C++ grammer to language 'C++14' also
2 parents b379aed + 614af40 commit 6773761

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

lib/grammars.coffee

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,38 @@ module.exports =
138138

139139
'C++':
140140
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"]
141173
"File Based":
142174
command: "bash"
143175
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

Comments
 (0)