Skip to content

Commit

Permalink
add Mojo support (#1107) (#1185)
Browse files Browse the repository at this point in the history
* fix #1107

Adds support for Mojo language

* add Mojo support with test (#1107)

* add Mojo support with test (#1107)

* add Mojo support with test (#1107)
  • Loading branch information
jmccrystal authored Jan 14, 2025
1 parent 029045a commit f71c75d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
6 changes: 6 additions & 0 deletions languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1107,6 +1107,12 @@
"extensions": ["def"],
"line_comment": [";"]
},
"Mojo": {
"line_comment": ["#"],
"doc_quotes": [["\\\"\\\"\\\"", "\\\"\\\"\\\""], ["'''", "'''"]],
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["mojo", "🔥"]
},
"MonkeyC": {
"name": "Monkey C",
"extensions": ["mc"],
Expand Down
21 changes: 21 additions & 0 deletions tests/data/mojo.mojo
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 21 lines 15 code 3 comments 3 blanks


'''
This is a docstring.
# It has multiple lines.
This is the end of the docstring.
'''
def main():
# Hello Mojo!
string = "Hello Mojo!"
# The following line prints the string "Hello Mojo!"
print(string)

"""
This piece of code prints
the numbers "9", "6", and "3".
'Here is a quote.'
"""
for x in range(9, 0, -3):
print(x)

0 comments on commit f71c75d

Please sign in to comment.