Skip to content
Open
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: 8 additions & 1 deletion languages.json
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@
["(*", "*)"],
["/*", "*/"]
],
"extensions": ["mll", "mly", "vy"]
"extensions": ["mll", "mly"]
},
"Meson": {
"line_comment": ["#"],
Expand Down Expand Up @@ -2029,6 +2029,13 @@
"important_syntax": ["<script", "<style", "<template"],
"extensions": ["vue"]
},
"Vyper": {
"name": "Vyper",
"line_comment": ["#"],
"doc_quotes": [["\\\"\\\"\\\"", "\\\"\\\"\\\""], ["'''", "'''"]],
"quotes": [["\\\"", "\\\""], ["'", "'"]],
"extensions": ["vy"]
},
"WebAssembly": {
"line_comment": [";;"],
"quotes": [["\\\"", "\\\""], ["'", "'"]],
Expand Down
49 changes: 49 additions & 0 deletions tests/data/vyper.vy
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 49 lines 31 code 10 comments 8 blanks
# ```vyper
# @external
# def main():
# # Comment
#
# log Hello(message="Hello World!")
# ```
# pragma version ~=0.4.0

event Hello:
message: String[32]

owner: public(address)

@deploy
def __init__():
start: String[32] = "###\""
# comment
self.owner = msg.sender

@internal
def _call1():
return

@internal
def _call2():
return

@external
def foo(name: String[32]) -> String[64]:
this_ends: String[32] = "a \"test#."
self._call1()
self._call2()
this_does_not: String[64] = "# nested # phrase \" #"
return this_does_not

@external
def foobar() -> bool:
does_not_start: String[64] = "until here, test# test" # a quote: "
also_doesnt_start: String[64] = "until here, test,# test" # another quote: "
return True

@external
def foo_again() -> uint256:
a: uint256 = 4 # #
b: uint256 = 5
c: uint256 = 6 # #
return a + b + c
Loading