Skip to content

Commit

Permalink
Add support for slang
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed May 6, 2024
1 parent 266c063 commit 43d0843
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 25 deletions.
1 change: 1 addition & 0 deletions LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ sed (sed)
Shell (sh,.tcshrc)
Sieve (sieve)
SKILL (il)
Slang (slang)
Smarty Template (tpl)
Snakemake (smk,rules,snakefile)
SNOBOL (sno)
Expand Down
46 changes: 23 additions & 23 deletions SCC-OUTPUT-REPORT.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<th>453</th>
<th>7424</th>
<th>1516</th>
<th>400453</th>
<th>401033</th>
<th>3929</th>
</tr><tr>
<td>processor/workers_test.go</td>
Expand Down Expand Up @@ -220,16 +220,6 @@
<td>20</td>
<td>949</td>
<td>31</td>
</tr><tr>
<td>processor/filereader.go</td>
<td></td>
<td>52</td>
<td>10</td>
<td>10</td>
<td>32</td>
<td>6</td>
<td>1329</td>
<td>37</td>
</tr><tr>
<td>cmd/badges/simplecache_test.go</td>
<td></td>
Expand All @@ -240,6 +230,16 @@
<td>9</td>
<td>1041</td>
<td>30</td>
</tr><tr>
<td>processor/filereader.go</td>
<td></td>
<td>52</td>
<td>10</td>
<td>10</td>
<td>32</td>
<td>6</td>
<td>1329</td>
<td>37</td>
</tr><tr>
<td>processor/cocomo.go</td>
<td></td>
Expand Down Expand Up @@ -270,16 +270,6 @@
<td>2</td>
<td>1051</td>
<td>29</td>
</tr><tr>
<td>processor/helpers.go</td>
<td></td>
<td>32</td>
<td>6</td>
<td>4</td>
<td>22</td>
<td>2</td>
<td>544</td>
<td>21</td>
</tr><tr>
<td>processor/structs_test.go</td>
<td></td>
Expand All @@ -290,6 +280,16 @@
<td>4</td>
<td>517</td>
<td>19</td>
</tr><tr>
<td>processor/helpers.go</td>
<td></td>
<td>32</td>
<td>6</td>
<td>4</td>
<td>22</td>
<td>2</td>
<td>544</td>
<td>21</td>
</tr><tr>
<td>processor/processor_unix_test.go</td>
<td></td>
Expand Down Expand Up @@ -318,7 +318,7 @@
<td>0</td>
<td>4</td>
<td>0</td>
<td>173965</td>
<td>174545</td>
<td>5</td>
</tr></tbody>
<tfoot><tr>
Expand All @@ -329,7 +329,7 @@
<th>453</th>
<th>7424</th>
<th>1516</th>
<th>400453</th>
<th>401033</th>
<th>3929</th>
</tr>
<tr>
Expand Down
15 changes: 15 additions & 0 deletions examples/language/slang.slang
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// 15 lines 8 code 4 comments 2 blanks

Texture2D<float4> in_tex;
RWTexture2D<float4> out_tex;

// Blit compute shader
[shader("compute")]
[numthreads(8, 8, 1)]
void main(uint2 id: SV_DispatchThreadID) {
/*
Perform the blit
*/
out_tex[id] = in_tex[id];
return;
}
33 changes: 33 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -3857,6 +3857,39 @@
}
]
},
"Slang": {
"complexitychecks": [
"for ",
"for(",
"if ",
"if(",
"switch ",
"while ",
"else ",
"|| ",
"&& ",
"!= ",
"== "
],
"extensions": [
"slang"
],
"line_comment": [
"//"
],
"multi_line": [
[
"/*",
"*/"
]
],
"quotes": [
{
"end": "\"",
"start": "\""
}
]
},
"JavaScript": {
"complexitychecks": [
"for ",
Expand Down
2 changes: 1 addition & 1 deletion processor/constants.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ else
fi

# Try out specific languages
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell ' 'Racket ' 'DOT ' 'YAML ' 'Teal ' 'FSL ' 'INI ' 'Hare ' 'Templ ' 'Cuda ' 'GraphQL ' 'Bicep ' 'Pkl ' 'TypeSpec ' 'LALRPOP ' 'Snakemake ' 'OpenQASM ' 'Typst ' 'ZoKrates ' 'Chapel '
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell ' 'Racket ' 'DOT ' 'YAML ' 'Teal ' 'FSL ' 'INI ' 'Hare ' 'Templ ' 'Cuda ' 'GraphQL ' 'Bicep ' 'Pkl ' 'TypeSpec ' 'LALRPOP ' 'Snakemake ' 'OpenQASM ' 'Typst ' 'ZoKrates ' 'Chapel ' 'Slang '
do
if ./scc "examples/language/" | grep -q "$i "; then
echo -e "${GREEN}PASSED $i Language Check"
Expand Down

0 comments on commit 43d0843

Please sign in to comment.