Skip to content

Commit

Permalink
Add support for Red (exercism fork) (#12)
Browse files Browse the repository at this point in the history
* Add support for Red

* Disable Red/System files, conflict with Redscript language
  • Loading branch information
loziniak authored Feb 14, 2024
1 parent f2a342a commit 243d03e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,12 @@
"multi_line_comments": [["<!--", "-->"], ["@*", "*@"]],
"extensions": ["cshtml"]
},
"Red": {
"line_comment": [";"],
"multi_line_comments": [["comment [", "]"], ["comment {", "}"]],
"quotes": [["\\\"", "\\\""], ["{", "}"]],
"extensions": ["red"]
},
"Redscript": {
"name": "Redscript",
"line_comment": ["//", "///"],
Expand Down
20 changes: 20 additions & 0 deletions tests/data/red.red
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Red [] ; 20 lines 10 code 6 comments 4 blanks

x: 1 ; line comment 1
x: 2 ;-- line comment 2
x: 3 ;@@ line comment 3

comment ['this
'is 'multiline
'comment]
comment {and this
as well}

function add100 [x [integer!]] [
"; this should not count as comment "
{ comment [and neither
this] }
]

comment {unfortunately, tokei does not allow regexp in comment prefix}
; so probably previous block comment is not parsed properly

0 comments on commit 243d03e

Please sign in to comment.