-
Notifications
You must be signed in to change notification settings - Fork 43
/
Vyper.YAML-tmLanguage
79 lines (78 loc) · 2.68 KB
/
Vyper.YAML-tmLanguage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# [PackageDev] target_format: plist, ext: tmLanguage
---
name: Vyper
scopeName: source.vyper
fileTypes: [vy]
uuid: ad87d2cd-8575-4afe-984e-9421a3788911
patterns:
- match: \#.*
name: comment
comment: Comments
- begin: (\"\"\")
end: (\"\"\")
name: comment
comment: Multiline comments
- match: \b(event|indexed)\b
name: keyword.control
comment: Events
- match: \b(contract|interface|library|using|struct|constructor|modifier)(\s+[A-Za-z_]\w*)?(?:\s+is\s+((?:[A-Za-z_][\,\s]*)*))?\b
name: keyword.control
captures:
'2': {name: entity.name.function}
'3': {name: entity.name.function}
comment: Structures, event definitions
- match: \b(def)(\s+[A-Za-z_]\w*)?\b
name: keyword.declaration.function
captures:
'2': {name: entity.name.function}
'3': {name: entity.name.function}
comment: function
- match: \b(True|False)\b
name: constant.language
comment: True and false keywords
- match: \bself\b
name: storage.type.function
comment: self variable
- match: \b(address(?:\s+payable)?|string|bytes?\d*|int\d*|uint\d*|bool|u?fixed\d+x\d+)\b
captures:
'1': {name: constant.language}
'2': {name: constant.numeric}
'3': {name: constant.numeric}
'4': {name: keyword.control}
comment: Types
- match: \b(constant|map|raise|payable|storage|memory|calldata|if|else|for|while|do|break|continue|return|private|public|immutable|pure|view|internal|external|this|suicide|selfdestruct|delegatecall|emit|new|is|throw|revert|assert|require|\_)\b
name: keyword.control
comment: Langauge keywords
- match: \b(not|and|or|pass|from|import|as)\b
name: keyword
comment: Vyper specific keywords
- match: (@[A-Za-z_]\w*)\b
name: keyword
comment: Vyper decorators
- match: (=|!|>|<|\||&|\?|\^|~|\*|\+|\-|\/|\%|\bhex\b)
name: keyword.operator
comment: Operators
- match: \b(msg|block|tx)\.([A-Za-z_]\w*)\b
captures:
'1': {name: storage.type}
'2': {name: storage.type}
comment: msg and block special usage
# - match: \b(blockhash|gasleft|addmod|mulmod|keccak256|sha256|sha3|ripemd160|ecrecover)\s*\(
# captures:
# '1': {name: constant.language}
# comment: Function call - built-in functions
- match: \b([A-Za-z_]\w*)(?:\[(\d*)\])?(?:\[(\d*)\])?\(
captures:
'1': {name: support.function}
'2': {name: constant.numeric}
'3': {name: constant.numeric}
comment: Function call, also for example - uint[] memory a = new uint[332](7); or uint[2][] memory arrayOfPairs = new uint[2][](size);
- match: ([\"\'].*?[\"\'])
name: string.quoted
comment: Strings
- match: \b(?:[+-]?\.?\d[\d_eE]*)(?:\.\d+[\deE]*)?\b
name: constant.numeric
comment: Numbers, possibly with scientific notation
- match: \b(0[xX][a-fA-F0-9]+)\b
name: constant.numeric
comment: Hexadecimal