Skip to content

Commit

Permalink
Add support for Cap n Proto (#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter authored May 20, 2024
1 parent 9cb823d commit 62f06df
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 34 deletions.
1 change: 1 addition & 0 deletions LANGUAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ C++ (cc,cpp,cxx,c++,pcc,ino)
C++ Header (hh,hpp,hxx,inl,ipp)
Cabal (cabal)
Cairo (cairo)
Cap'n Proto (capnp)
Cassius (cassius)
Ceylon (ceylon)
Chapel (chpl)
Expand Down
26 changes: 13 additions & 13 deletions SCC-OUTPUT-REPORT.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<th>458</th>
<th>7545</th>
<th>1542</th>
<th>406094</th>
<th>406318</th>
<th>4017</th>
</tr><tr>
<td>processor/formatters.go</td>
Expand Down Expand Up @@ -270,16 +270,6 @@
<td>6</td>
<td>699</td>
<td>23</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>175605</td>
<td>175829</td>
<td>5</td>
</tr></tbody>
<tfoot><tr>
Expand All @@ -329,7 +329,7 @@
<th>458</th>
<th>7545</th>
<th>1542</th>
<th>406094</th>
<th>406318</th>
<th>4017</th>
</tr>
<tr>
Expand Down
26 changes: 26 additions & 0 deletions examples/language/capnproto.capnp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@0xdbb9ad1f14bf0b36; # unique file ID, generated by `capnp id`

struct Person {
name @0 :Text;
birthdate @3 :Date;

email @1 :Text;
phones @2 :List(PhoneNumber);

struct PhoneNumber {
number @0 :Text;
type @1 :Type;

enum Type {
mobile @0;
home @1;
work @2;
}
}
}

struct Date {
year @0 :Int16;
month @1 :UInt8;
day @2 :UInt8;
}
49 changes: 30 additions & 19 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,17 @@
}
]
},
"Cap'n Proto": {
"complexitychecks": [],
"extensions": [
"capnp"
],
"line_comment": [
"#"
],
"multi_line": [],
"quotes": []
},
"Cassius": {
"complexitychecks": [
"for ",
Expand Down Expand Up @@ -8987,6 +8998,24 @@
}
]
},
"Web Services Description Language": {
"extensions": [
"wsdl"
],
"line_comment": [],
"multi_line": [
[
"<!--",
"-->"
]
],
"quotes": [
{
"end": "\"",
"start": "\""
}
]
},
"WebGPU Shading Language": {
"complexitychecks": [
"for (",
Expand Down Expand Up @@ -9015,24 +9044,6 @@
]
]
},
"Web Services Description Language": {
"extensions": [
"wsdl"
],
"line_comment": [],
"multi_line": [
[
"<!--",
"-->"
]
],
"quotes": [
{
"end": "\"",
"start": "\""
}
]
},
"Windows Resource-Definition Script": {
"extensions": [
"rc"
Expand Down Expand Up @@ -9379,4 +9390,4 @@
"zsh"
]
}
}
}
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 @@ -906,7 +906,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 ' 'Slang ' 'Circom '
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 ' 'Circom ' 'Proto '
do
if ./scc "examples/language/" | grep -q "$i "; then
echo -e "${GREEN}PASSED $i Language Check"
Expand Down

0 comments on commit 62f06df

Please sign in to comment.