Skip to content

Commit 2912212

Browse files
committed
fix: fix the C exports names
1 parent d0d37ef commit 2912212

File tree

2 files changed

+36
-27
lines changed

2 files changed

+36
-27
lines changed

lib/grammars.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import grammarMap from "./grammars/index"
44

55
import * as apple from "./grammars/apple"
6-
import * as c from "./grammars/c"
6+
import c from "./grammars/c"
77
import * as coffeescript from "./grammars/coffeescript"
88
import database from "./grammars/database"
99
import * as doc from "./grammars/doc"

lib/grammars/c.js

Lines changed: 35 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function args({ filepath }) {
3232
return ["-c", cmdArgs]
3333
}
3434

35-
export const C = {
35+
const C = {
3636
"File Based": {
3737
command: "bash",
3838
args({ filepath }) {
@@ -75,7 +75,7 @@ export const C = {
7575
},
7676
}
7777

78-
exports["C#"] = {
78+
const Cs = {
7979
"Selection Based": {
8080
command,
8181
args(context) {
@@ -101,7 +101,7 @@ exports["C#"] = {
101101
},
102102
},
103103
}
104-
exports["C# Script File"] = {
104+
const CSScriptFile = {
105105
"Selection Based": {
106106
command: "scriptcs",
107107
args(context) {
@@ -118,7 +118,7 @@ exports["C# Script File"] = {
118118
},
119119
}
120120

121-
exports["C++"] = {
121+
const Cpp = {
122122
"Selection Based": {
123123
command: "bash",
124124
args(context) {
@@ -175,30 +175,39 @@ exports["C++"] = {
175175
},
176176
},
177177
}
178-
exports["C++14"] = exports["C++"]
178+
const Cpp14 = Cpp
179179

180-
if (os === "darwin") {
181-
exports["Objective-C"] = {
182-
"File Based": {
183-
command: "bash",
184-
args({ filepath }) {
185-
return [
186-
"-c",
187-
`xcrun clang ${options} -fcolor-diagnostics -framework Cocoa '${filepath}' -o /tmp/objc-c.out && /tmp/objc-c.out`,
188-
]
189-
},
180+
const ObjectiveC = {
181+
"File Based": {
182+
command: "bash",
183+
args({ filepath }) {
184+
return [
185+
"-c",
186+
`xcrun clang ${options} -fcolor-diagnostics -framework Cocoa '${filepath}' -o /tmp/objc-c.out && /tmp/objc-c.out`,
187+
]
190188
},
191-
}
189+
},
190+
}
192191

193-
exports["Objective-C++"] = {
194-
"File Based": {
195-
command: "bash",
196-
args({ filepath }) {
197-
return [
198-
"-c",
199-
`xcrun clang++ -Wc++11-extensions ${options} -fcolor-diagnostics -include iostream -framework Cocoa '${filepath}' -o /tmp/objc-cpp.out && /tmp/objc-cpp.out`,
200-
]
201-
},
192+
const ObjectiveCpp = {
193+
"File Based": {
194+
command: "bash",
195+
args({ filepath }) {
196+
return [
197+
"-c",
198+
`xcrun clang++ -Wc++11-extensions ${options} -fcolor-diagnostics -include iostream -framework Cocoa '${filepath}' -o /tmp/objc-cpp.out && /tmp/objc-cpp.out`,
199+
]
202200
},
203-
}
201+
},
202+
}
203+
204+
const CGrammars = {
205+
C,
206+
"C++": Cpp,
207+
"C++14": Cpp14,
208+
"C#": Cs,
209+
"C# Script File": CSScriptFile,
210+
"Objective-C": ObjectiveC,
211+
"Objective-C++": ObjectiveCpp,
204212
}
213+
export default CGrammars

0 commit comments

Comments
 (0)