Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Roc language #1197

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1482,6 +1482,15 @@
"blank": true,
"extensions": ["rst"]
},
"Roc": {
"line_comment": ["#"],
"quotes": [
["\\\"", "\\\""],
["'", "'"]
],
"doc_quotes": [["\\\"\\\"\\\"", "\\\"\\\"\\\""]],
"extensions": ["roc"]
},
"RON": {
"name": "Rusty Object Notation",
"line_comment": ["//"],
Expand Down
36 changes: 36 additions & 0 deletions tests/data/roc.roc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 36 lines 18 code 10 comments 8 blanks
module [square]
# this is a comment
# this is another comment

a1 = 1
a2 = 3.14159 # pi

expect
# simple check
a1 == 1

expect
a2 |> Num.toStr == "3.14159"

## Compute the square
square = \x ->
s = x * x

# the line above is blank
s

expect square 3 == 9

## """
## this is not a multiline string,
## it's a doc comment
## """
multilineString =
"""
# this line is not a comment, it's actually code

The line above is not blank, it's actually code
"""

expect multilineString |> Str.toUtf8 |> List.first == Ok '#'
Loading