-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chore) Create
c-like
and c/cpp depend on that now
- chore(parser): effectively rename `cpp.js` to `c-like.js` [Josh Goebel][] - chore(parser): create new `c.js` (C), depends on `c-like` now [Josh Goebel][] - chore(parser): create new `cpp.js` (C), depends on `c-like` now [Josh Goebel][] - This will allow us to clean up C/C++ in the future without another breaking change by getting this require change out of the way early. (#2146)
- Loading branch information
1 parent
c845741
commit 5782ae5
Showing
5 changed files
with
61 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
Language: C | ||
Category: common, system | ||
Website: https://en.wikipedia.org/wiki/C_(programming_language) | ||
Requires: c-like.js | ||
*/ | ||
|
||
function(hljs) { | ||
|
||
var lang = hljs.getLanguage('c-like').rawDefinition(); | ||
// Until C is actually different than C++ there is no reason to auto-detect C | ||
// as it's own language since it would just fail auto-detect testing or | ||
// simply match with C++. | ||
// | ||
// See further comments in c-like.js. | ||
|
||
// lang.disableAutodetect = false; | ||
return lang; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
Language: C++ | ||
Category: common, system | ||
Website: https://isocpp.org | ||
Requires: c-like.js | ||
*/ | ||
|
||
function(hljs) { | ||
|
||
var lang = hljs.getLanguage('c-like').rawDefinition(); | ||
// return auto-detection back on | ||
lang.disableAutodetect = false; | ||
return lang; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters