Skip to content

Commit

Permalink
Add support for Chapel (#960)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielknight authored May 2, 2024
1 parent 820cfa3 commit 0f358fe
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
6 changes: 6 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,12 @@
"quotes": [["\\\"", "\\\""], ["\\\"\\\"\\\"", "\\\"\\\"\\\""]],
"extensions": ["ceylon"]
},
"Chapel": {
"line_comment": ["//"],
"multi_line_comments": [["/*", "*/"]],
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["chpl"]
},
"CHeader": {
"name": "C Header",
"line_comment": ["//"],
Expand Down
24 changes: 24 additions & 0 deletions tests/data/chapel.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// chapel 24 lines 9 code 9 comments 6 blanks

// Tidy line comment

/* Tidy block
comment.
*/

// Cheeky line comments /*
// */

/* Cheeky // block comments */

// Caculate a factorial
proc factorial(n: int): int {
var x = 1; // this will eventually be returned
for i in 1..n {
x *= i;
}
return x;
}

writeln("// this isn't a comment");
writeln('/* this is also not a comment */');

0 comments on commit 0f358fe

Please sign in to comment.