You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Requesting Support for Additional Languages](#requesting-support-for-additional-languages-)
50
+
*[Support for Additional Languages](#support-for-additional-languages-)
51
51
*[Reporting Problems](#reporting-problems-)
52
52
*[Citation](#citation-)
53
53
*[Acknowledgments](#acknowledgments-)
@@ -3111,10 +3111,81 @@ comments rather than code.
3111
3111
3112
3112
[](1}}})
3113
3113
<aname="AdditionalLanguages"></a> []({{{1)
3114
-
# [Requesting Support for Additional Languages ▲](#___top"click to go to top of document")
3114
+
# [Support for Additional Languages ▲](#___top"click to go to top of document")
3115
3115
3116
3116
If cloc does not recognize a language you are interested in counting,
3117
-
create a [GitHub issue](https://github.com/AlDanial/cloc/issues)
3117
+
you can either
3118
+
3119
+
1.[implement it yourself](#implement-it-yourself),
3120
+
2.[request it to be implemented](#request-to-implement).
3121
+
3122
+
<aname="implement-it-yourself"></a> []({{{1)
3123
+
## Implement an Additional Language
3124
+
3125
+
In short, you will need to:
3126
+
3127
+
- edit the `cloc` file:
3128
+
3129
+
- look for `%{$rh_Language_by_Extension} = ( # {{{1` and add, respecting the alphabetical order,
3130
+
3131
+
```
3132
+
'<ext>' => '<Language Name>' ,
3133
+
```
3134
+
3135
+
where `<ext>` is the extension used by your language, and `<Language Name>` is its name. Repeat for each extension used by your language.
3136
+
3137
+
- look for `%{$rhaa_Filters_by_Language} = ( # {{{1`, and add, respecting the alphabetical order,
3138
+
3139
+
```
3140
+
'<LanguageName>' => [
3141
+
<list>
3142
+
],
3143
+
```
3144
+
3145
+
where `<Language Name>` is the name of the language you are implementing, and `<list>` is a list of filter options (whose documentation remains to be written -- take inspiration from existing languages).
3146
+
3147
+
- look for `%{$rh_Scale_Factor} = ( # {{{1`, and add, respecting the alphabetical order,
3148
+
3149
+
```
3150
+
'<Language Name>' => <factor>,
3151
+
```
3152
+
3153
+
where `<Language Name>` is the name of the language you are implementing, and `<factor>` is a [third generation language scale factor](#third-generation-language-scale-factors-).
3154
+
3155
+
- edit the `Readme.md` file, adding under ["Recognized Languages"](#recognized-languages-)
3156
+
3157
+
```
3158
+
<LanguageName> (<listofextensions>)
3159
+
```
3160
+
3161
+
for `<Language Name>` the name of the language you are implementing, and `<list of extensions>` the list of extensions you declared in `rh_Language_by_Extension`.
3162
+
3163
+
- (optional, but recommended) Add a test case:
3164
+
3165
+
- Create a `tests/inputs/<Language name>.<extension>` file, containing some code written in `<Language name>`,
3166
+
- Generate a `tests/outputs/<Language name>.<extension>.yaml` file, using
- Make sure you examine the output of `tests/outputs/<Language name>.<extension>.yaml` and that it is correct, then run `make test` from the `Unix` folder to make sure your test was successful.
3182
+
3183
+
You can use [this pull request](https://github.com/AlDanial/cloc/pull/962) or [this one](https://github.com/AlDanial/cloc/pull/947) as guidelines.
3184
+
3185
+
<a name="implement-it-yourself"></a> []({{{1)
3186
+
## Request an Additional Language
3187
+
3188
+
Create a [GitHub issue](https://github.com/AlDanial/cloc/issues)
3118
3189
requesting support for your language. Include this information:
3119
3190
<ol>
3120
3191
<li> File extensions associated with the language. If the language does
0 commit comments